0
Can someone show me how to make a variable array in python, using a while loop thanks :)
Beginner
7 Answers
+ 3
The better way is a list comprehention
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2454/
+ 2
bfo = ['brofarops', 'diversified']
bfo.append('services')
print(bfo)
0
What do you want to save in your array and why do you need a while loop for creating this array?
You can of course add elements to an array using a while loop but there are so many scenarios to do that
0
I need to save integers in the array and the while loop is just for a better understanding. Thanks
0
Ah okay so to make it variable just set x = input()
0
No its also variable if you say x=0 . With input() you can get user input. But if you want to get an int as input you have to cast the input to an int: x = int(input())
0
I see thankyou!