New course! Every coder should learn Generative AI!
Try a free lesson0
For loop
How to put all the elements that outputs the for loop in the list
1 Answer
+ 4
exists an append method for a list
a= []
a.append(2)
# a will be [2]
How to put all the elements that outputs the for loop in the list