+ 2

array

how can i fill the array by user with loop??? would you please send me form of this code....thanks

5th Jun 2019, 6:34 PM
reza
reza - avatar
11 Answers
+ 9
reza You're welcome.
5th Jun 2019, 6:55 PM
Luke
Luke - avatar
+ 6
What do you mean? By user? 😕😕😕
5th Jun 2019, 6:36 PM
Luke
Luke - avatar
+ 6
So what does he enter and what should be the result?
5th Jun 2019, 6:39 PM
Luke
Luke - avatar
+ 6
Do you mean something like this? https://code.sololearn.com/c63X1xKORoV7/?ref=app
5th Jun 2019, 6:45 PM
Luke
Luke - avatar
+ 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???
5th Jun 2019, 6:42 PM
reza
reza - avatar
+ 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)
5th Jun 2019, 6:49 PM
Trigger
Trigger - avatar
+ 2
i mean by someone that sit behind computer and run program
5th Jun 2019, 6:37 PM
reza
reza - avatar
+ 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
5th Jun 2019, 6:49 PM
reza
reza - avatar
+ 1
thanks thomas williams i understand now and thank you luke too
5th Jun 2019, 6:52 PM
reza
reza - avatar
0
I don't get it but if you get the answer please answer me then
6th Jun 2019, 1:37 PM
Anuj Raghu
Anuj Raghu - avatar
0
I don't get it the answer,if you someone get the answer,pls answer me then
23rd Mar 2020, 3:47 PM
PRIYANKA RAUT
PRIYANKA RAUT - avatar