+ 2
array
how can i fill the array by user with loop??? would you please send me form of this code....thanks
11 Antworten
+ 9
reza You're welcome.
+ 6
What do you mean? By user? 😕😕😕
+ 6
So what does he enter and what should be the result?
+ 6
Do you mean something like this?
https://code.sololearn.com/c63X1xKORoV7/?ref=app
+ 3
for example he enter some number and we want to save them in array...if we save one by one ,it take a long time so we should fill array with loops...i want to know how we can???
+ 3
Does the program take input every time it iterates, and then adds that to the loop?
array = []
while True:
inp = input("Enter Value: ")
if inp != '':
array.append(inp)
else:
break
print('\n\n' + ', '.join(array))
The result of this would be:
Enter Value: h
Enter Value: e
Enter Value: l
Enter Value: l
Enter Value:
>>> h, e, l, l
(The user would enter the values one at a time, and if the user just presses enter the loop will end)
+ 2
i mean by someone that sit behind computer and run program
+ 1
no no ...in this program we just enter one number at first....i mean if we want to enter a number for every argument of array....for example we want to fill array that have 100 argue
+ 1
thanks thomas williams i understand now and thank you luke too
0
I don't get it but if you get the answer please answer me then
0
I don't get it the answer,if you someone get the answer,pls answer me then