- 1

num = 12 if num > 5: print("Bigger than 5") if num <=47: print("Between 5 and 47")

Bro how is possible

10th Oct 2020, 2:16 AM
Hacker Tamil Tamila
Hacker Tamil Tamila - avatar
5 RĂ©ponses
+ 2
It's print both. Because 12 is greater than 5 and also less than 47.
10th Oct 2020, 2:26 AM
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~ - avatar
+ 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")
10th Oct 2020, 2:28 AM
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~ - avatar
+ 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.
10th Oct 2020, 2:24 AM
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~
0_O-[MĂ€gĂĄr_SĂĄm_ÄkĂ _NĂŒllpÞïntĂȘr_ÈxĂ«cĂ©ptïön]~~ - avatar
+ 1
Exactly what answer you need? Related to condition or output mention what output you need
10th Oct 2020, 5:19 AM
AzhagesanăƒŸ(✿)
AzhagesanăƒŸ(✿) - avatar
- 1
bharathi = 10 if bharathi < 5: print("tamil") if bharathi <= 10: print("hello") Bro
10th Oct 2020, 2:31 AM
Hacker Tamil Tamila
Hacker Tamil Tamila - avatar