Hello Guys,I need a code to append int values in a list, untill we enter the nagetive value. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hello Guys,I need a code to append int values in a list, untill we enter the nagetive value.

The length of list will gonna increase, once we enter a negative value to insert into the list, the appending need to be stopped

20th Feb 2022, 9:35 AM
S GOUSE BASHA
S GOUSE BASHA - avatar
7 Answers
+ 4
while num >=0: That should get you started. Follow the prompts from Lisa & review your lessons
20th Feb 2022, 10:03 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 3
Please show your own attempt. Hint: * create an empty list * use a while loop * get input inside of loop * convert input to integer * if integer is small than 0, break; else append to list
20th Feb 2022, 9:42 AM
Lisa
Lisa - avatar
+ 2
while True # input # conversion # break or append
20th Feb 2022, 10:01 AM
Lisa
Lisa - avatar
+ 1
while n>=0: #append to list #decrement
21st Feb 2022, 1:25 PM
Pythøñ Cúltîst⚔️🔥🇳🇬
Pythøñ  Cúltîst⚔️🔥🇳🇬 - avatar
0
Could you please tell me, what is the condition I need to take at while loop, >>> while ? : At "?" What I need to write
20th Feb 2022, 9:58 AM
S GOUSE BASHA
S GOUSE BASHA - avatar
0
Thanks alot 🥳🥳🥳
20th Feb 2022, 10:02 AM
S GOUSE BASHA
S GOUSE BASHA - avatar
0
Sure 🥳
20th Feb 2022, 10:03 AM
S GOUSE BASHA
S GOUSE BASHA - avatar