0

What is wrong with this code?

It's supposed to add variables to "actions" until it reaches "action_ammount" and print the list. Here's the code: print("How many actions do you want?") action_ammount = int(input()) i = 1 actions = [] while i <= action_ammount: actions.append(1) print(actions)

11th Dec 2019, 3:59 PM
Alan is not my real name
Alan is not my real name - avatar
2 Answers
+ 1
you'll need to increase the value of i or the condition will never met. simply adding i+=1 should fix it
11th Dec 2019, 4:00 PM
Taste
Taste - avatar
0
Totally forgot, thanks
11th Dec 2019, 4:06 PM
Alan is not my real name
Alan is not my real name - avatar