Click here to Skip to main content
15,890,506 members

Comments by beginner20060403 (Top 9 by date)

beginner20060403 30-Jan-21 11:02am View    
File "<string>", line 4
if (weight >=5.0):
^
IndentationError: unexpected indent
>
when I delete the else it gives me this error
can you help me
beginner20060403 30-Jan-21 10:55am View    
File "<string>", line 4
else:
^
SyntaxError: invalid syntax
>
This error I get when I run this program.
can you help me to solve the problem?
thank you
beginner20060403 30-Jan-21 10:46am View    
Hello
it still have a SyntaxError can you help me, please?
thank you
beginner20060403 30-Jan-21 3:01am View    
what can I do to solve the SyntaxError
thank you
beginner20060403 30-Jan-21 2:57am View    
Deleted
Hello
I had change my code into :
weight=0.0
weight=float(input("Enter a weight in kilograms:"))

else:
if (weight >=5.0):
print("Open Green gate.")
elif(weight >=2.0):
print("Open Red gate.")
elif(weight <= 1.0):
print("Open Yellow gate.")
but it still give me a error said :
else:
^
SyntaxError: invalid syntax

what can I do to solve the SyntaxError here
thank you