0
this code
if X: print("1") means if X is correct then print 1. right?
3 odpowiedzi
+ 2
Almost. It means "if X is *True*..." That works if X is a boolean (variable or expression), or if it can be coerced into a boolean value.
+ 2
yes what you said is correct. X has to be True to print(1)
also don't put 1 in brackets '1' because it will be considered as a string(a word) and not as a number. And if also works if x==1 for exemple :
X==1
if X:
print(2)
+ 1
thank u so much!