r/pythonhelp • • Dec 03 '20

Python Syntax Errors

Hi!

I was practicing some pretty easy scripts and all it does is see what a number is and print 'big' or 'small'. so can anyone tell me what the problem is?

x = 5

if x = 5 :

print('big')

if x = 1 :

print('small')

print('done!')

Also im using Pyscripter as an IDE

2 Upvotes

5 comments sorted by

View all comments

1

u/scoopulanang Dec 04 '20

It could be indentation but if statements require a double equal sign instead of a single one. For instance,

if x == 5:
    #do something

Double equal signs is a comparison operator. It compares both values on either side of the operator to see if they are equal. The single equal sign assigns a value to something.

x = 5

We assigned a value of 5 to x.