0
what??
num= 7 if num>5: print("ok") if num==7 print("š") why is ok correct??
4 Answers
+ 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?