- 1
num = 12 if num > 5: print("Bigger than 5") if num <=47: print("Between 5 and 47")
Bro how is possible
5 Antworten
+ 2
It's print both. Because 12 is greater than 5 and also less than 47.
+ 2
In simple you can also rewrite your code as below
num = 12
if num > 5 and num <=47:
print("Bigger than 5")
print("Between 5 and 47")
+ 1
It's a nested if statement. In the true case of first statement the second statement runs.
If first statement is false than the second statement didn't run.
+ 1
Exactly what answer you need? Related to condition or output mention what output you need
- 1
bharathi = 10
if bharathi < 5:
print("tamil")
if bharathi <= 10:
print("hello")
Bro