Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
homework
#1
ArPe = str(input("Area Or Perimeter? "))
print("Ok " + ArPe + " we will calculate"):
    if arpe == "area" or "perimeter":
        x = "true"
    elif arpe == null or int:
        x = false 
    else:
        print("wot have u done?")
print(x)
Error:
File "/home/main.py", line 2 print("Ok " + ArPe + " we will calculate"): ^ SyntaxError: invalid syntax
i dont understand :( help
Reply
#2
A colon at the end of a line indicates the start of an indented block of code, but it can only come after certain statements (if/elif/else, for/while, class/def, try/except/finally, with). The print function does not qualify.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020