Python Forum
First Program, Syntax Issues
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
First Program, Syntax Issues
#1
Please help. My first few lessons and attempt at python. Using Spyder (Python 3.7)

salary = 5000
If salary > 5000:
    print ("Approved")
Am getting the following error when running.
Error:
File "C:\Users\heetesh.j.bhoola\untitled15.py", line 9 If salary > 5000: ^ SyntaxError: invalid syntax
Reply
#2
First, please use the python tags when posting code, otherwise indentation is lost. And, in Python, indentation is incredibly important.

Python is case sensitive. Change the If to if.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Having issues getting a multiple choice test program to work Py_JohnS 2 3,422 Sep-01-2018, 11:06 PM
Last Post: Py_JohnS
  Nead help with my calculator program- getting syntax error FantasyCookie17 2 2,557 Aug-29-2018, 04:25 AM
Last Post: FantasyCookie17
  Syntax Error in Program bijay1983 2 2,972 Dec-24-2017, 05:36 PM
Last Post: squenson
  invalid syntax in my program, really doing my head in! Fazz92 1 3,874 May-07-2017, 12:54 PM
Last Post: Bass
  Very first Python program generates a syntax error n8ves 2 3,672 Feb-07-2017, 01:51 AM
Last Post: n8ves

Forum Jump:

User Panel Messages

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