+ 2
i wanna write program "42" (Python) but i cant
x=0 x=x+1 if x=42: print ("answer")
2 Réponses
+ 12
use '==' for comparison
x = 42 assigns 42 to x
x == 42 returns True if x is equal to 42
+ 1
You can also do this
if x is 42:
print (answer)
x=0 x=x+1 if x=42: print ("answer")