czheo
czheo
MModular
Created by Helehex on 9/20/2023 in #questions
Pass variadic arguments or parameters?
fn func1(l: VariadicList[Int]):
for i in range(len(l)): print(l[i])

fn func1(*a: Int):
func1(a)

fn func2(*a: Int):
func1(a)

fn main():
func1(1, 2)
func2(1, 2, 3)
fn func1(l: VariadicList[Int]):
for i in range(len(l)): print(l[i])

fn func1(*a: Int):
func1(a)

fn func2(*a: Int):
func1(a)

fn main():
func1(1, 2)
func2(1, 2, 3)
2 replies