+ 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
12 Réponses
+ 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)
0
Pls tell me where im making mistake
0
Oh i forgot to break the loop
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
0
Wait im dumb
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)
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
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