0

Why does the code below return the error "SyntaxError: invalid syntax"

If(amount_paid==12):

I know it's basic but just starting out learning Python in Visual Studio Code

Thanks for any help,

Phil

5
  • Python is case sensitive Commented May 29, 2020 at 2:07
  • @Nick almost certainly... i can't find a good duplicate at the moment, but I'm on my phone so please feel free to offer up a good one Commented May 29, 2020 at 2:13
  • Fixed! Sorry, didn't notice the upper Case I in the if keyword, thanks for the help. Commented May 29, 2020 at 2:17
  • Does this answer your question? Invalid syntax---python Commented May 29, 2020 at 2:23
  • @juanpa.arrivillaga there's a couple there now Commented May 29, 2020 at 2:26

3 Answers 3

4

Most things in Python are case-sensitive. Here, that's the if construct -- If amount_paid == 12: is not well formed, but if amount_paid == 12: is.

Sign up to request clarification or add additional context in comments.

3 Comments

python, in general, is case-sensitive.
Good point, will edit my answer.
Fixed! Sorry, didn't notice the upper Case I in the if keyword, thanks for the help.
0

Try making If lowercase (make the "I" lowercase)

1 Comment

Fixed! Sorry, didn't notice the upper Case I in the if keyword, thanks for the help.
0
  1. The issue in the upper case "If". Change to "if"
  2. Parentheses are not mandatory, although, they should not affect anything in your case: if amount_paid == 12:

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.