How is 19<=19 True?


#1

As obvious, 19 is equal to 19 i.1., 19 ==19 and some how the program results an error. Can anyone explain the reason why it is true.


#2

You absolutely MUST space out the terms. Otherwise, the syntax will have an error. Try this: "9 == 9"


#3

if still need help post full code please


#4

@rishket

That statement is completely incorrect. There is a convention for coding style of Python , though in no way do you have to follow it. If coding 19==19 throws a syntax error for you then there is something else causing the problem.

It is true that python requires at least one space between words in order to decipher what we are telling it to do, but that same requirement is not true of operators such as >, <, = ect...

Also a an note none of the following if statements follow the Pep, so try not to code like that for your own sanity.

EXAMPLE:

x = 1 #WORKS
y=2 #WORKS
if x < 2: print(True) #WORKS
if x<2:print(True) #WORKS
ifx<2:print(True) # DOES NOT WORK


#5

Oh OK then, I had not realized that as I thought the space punctuation was taken too seriously. Thank You.