0
what??
num= 7 if num>5: print("ok") if num==7 print("👌") why is ok correct??
4 odpowiedzi
+ 10
The correct code will be something like this...
num= 7
if num>5:
print("ok")
if num==7:
print("7") #use any string or no. instead of 7
The 👌 u used cannot be printed in SL...
Output:
#ok
#7
+ 2
because num is more than 5. so the following condition is executed.
+ 1
this due to precedence because first condition is true it prints ok now i think it never reach to the next condition but i think that would happen when you use a elif condition. i dont know python a lot, but generally i think its because of the precednce of conditions.
0
th numb is also 7
i mean
num==7
is true isn't it?