Continue (help why it doesn’t work) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Continue (help why it doesn’t work)

Why this doesn’t work total = 0 #your code goes here total = 0 ticket = 100 a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) age =[a, b, c, d, e] i = 0 while True: while(i < len(age) -1): i += 1 if( age[i]< 3): continue total += ticket print(total) In here https://www.sololearn.com/learning/1172/5216/13991/1

12th Mar 2022, 11:44 PM
Umar Farooq
8 Answers
+ 2
total = 0 #your code goes here ticket = 100 price = 0 while total < 5: age = int(input()) total += 1 if age < 3: continue else: price += ticket print(price)
9th Jun 2022, 1:43 PM
Arif Cahyo Wibisono
Arif Cahyo Wibisono - avatar
0
Pls tell me where im making mistake
12th Mar 2022, 11:44 PM
Umar Farooq
0
Oh i forgot to break the loop
12th Mar 2022, 11:47 PM
Umar Farooq
0
total = 0 #your code goes here total = 0 ticket = 100 a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) age =[a, b, c, d, e] i = 0 while age[i] < 6: while(i < len(age) -1): i += 1 if( age[i]< 3): continue total += ticket print(total) This is also not working
12th Mar 2022, 11:49 PM
Umar Farooq
0
Wait im dumb
12th Mar 2022, 11:50 PM
Umar Farooq
0
Although your input method is not the best, it will still work. Replace your "while" loops with: for x in age: if x > 3: # i'm not sure what the criteria is, so change it if required. total += 100 print(total)
13th Mar 2022, 12:09 AM
rodwynnejones
rodwynnejones - avatar
0
total = 0 #your code goes here x = 0 while x <= 5: age = int(input()) if age > 2: total += 100 x += 1 print(x) Its 100% correct but its giving Eof error
13th Mar 2022, 12:30 AM
Umar Farooq
0
total = 0 #your code goes here try: while(True): i=int(input()) if i>3: total+=100 except: print(total) Try this, Error because in question they said 5 inputs but the test cases are accepting different no.of inputs so it's giving EOFERROR
17th May 2022, 5:51 AM
Harsha Sai Ganesh Pabolu