15,890,506 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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
beginner20060403
29-Jan-21 15:19pm
View
thank you
beginner20060403
29-Jan-21 15:19pm
View
thank you
beginner20060403
29-Jan-21 11:40am
View
Hello
I don't understand why the if statement needs to match up the elif statement? can you please explain to me?
thank you
beginner20060403
29-Jan-21 11:24am
View
Deleted
Hello, I don't understand why elif need to match up if?
can you help me, please?
thank you
Show More