- 3
Can anyone help me with phyton m
I can't get the output in lesson 24 problem
16 Respuestas
+ 5
Do it like this
total = 0
x = 0
while x<5:
age = int(input())
if age >3:
total+=100
x+=1
print(total)
+ 6
20 3015 Harish ,
please link your attempt here, so that we can see what the issue is.
thank you!
+ 6
20 3015 Harish ,
please use a proper indentation in your python code. this means 4 spaces per indentation level.
this is recommended in the PEP 8:
https://www.python.org/dev/peps/pep-0008/
+ 4
You need to unindent last 2 lines to work it.
I mean x+=1 should be same as if statement block while print needs to be outside loop.
+ 3
Simba that's perfectly works
Thanks a lot
+ 1
What is your main question
+ 1
Yes but there must be input
+ 1
20 3015 Harish
Are you trying to take in put each time the while loop runs ?
0
Which 1 bro
24.1 has 3 problems
0
24.2 the practice
0
total = 0
x = 0
while x<5:
age = int(input())
if age >3:
total+=100
x+=1
print(total)
I don't know where I did a mistake
0
It's showing there is mistake in line 5
Age = int(input())
What should I do
Can anyone share their codes
0
I used bits and saw the answer
I exactly have the same code
But I got a E0F error in line 5
How should I fix it
The problem is on line 5
0
Simba
It is showing error with the input function
I think we need to avoid such problems
0
I am frustrated by this
0
is it this? total=0
x=0
while x<5:
age = int(input())
if age>3:
total += 100
x+=1
print (total)