zip() function
Publié : jeu. mars 28, 2019 12:13 am
Hello
zip iterates over the dimension of the least argument
zip('+',[a,b,c,d], [1,2,3]) > [a+1,b+2,c+3]
zip('+',[a,b,c], [1,2,3,4]) > [a+1,b+2,c+3]
strList := ["one", "two","three"]
numbersList := [1, 2, 3]
result = zip(strList,numbersList) >
[["one",1],
["two",2],
["three",3]]
but in the following case it generates an error
strList := ["one", "two"]
numbersList := [1, 2, 3]
result = zip(strList,numbersList) > "Error"
expected
[["one",1],
["two",2]]
zip iterates over the dimension of the least argument
zip('+',[a,b,c,d], [1,2,3]) > [a+1,b+2,c+3]
zip('+',[a,b,c], [1,2,3,4]) > [a+1,b+2,c+3]
strList := ["one", "two","three"]
numbersList := [1, 2, 3]
result = zip(strList,numbersList) >
[["one",1],
["two",2],
["three",3]]
but in the following case it generates an error
strList := ["one", "two"]
numbersList := [1, 2, 3]
result = zip(strList,numbersList) > "Error"
expected
[["one",1],
["two",2]]