Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5
So, if u are taking list input from users using loop, there in the loop, u can specify that u want a number bigger than 50.
24th Feb 2019, 8:14 PM
Arushi Singhania
Arushi Singhania - avatar
0
if you're program runs such as the user inputs number then inserting it to a List, you do this pseudo: input num if sum(list) + num >= 50 append num to list On the creation of list and you want it to have a value of > 50, just add random stuff tiLL it reach 50 import random while True: if sum(list) < 50 list.append(random.randrange(0,whatEverNumber)) else break
24th Feb 2019, 9:14 PM
Joemel Bituin
Joemel Bituin - avatar