Bottom Page

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
Yoriz wrote May-23-2020, 09:02 PM:
Please post all code, output and errors (in it's entirety) between their respective tags. I did it for you this time, Here are instructions on how to do it yourself next time.
Quote
#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.
Quote

Top Page

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

Forum Jump:


Users browsing this thread: 1 Guest(s)