0

can someone give me an example of when we would use nested if statements?

just trying to wrap my head around if statements

13th Feb 2020, 6:51 PM
Maheen Hassan
Maheen Hassan - avatar
4 Respuestas
+ 4
when you have to check something that depends on another thing if age > 18: if > male: do something you can also use && or || which is “and” “or”
13th Feb 2020, 7:17 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 3
It is used when you want to have a condition after passing a condition. For example if a want to test a number if it is less than 100 and even if num < 100: if num%2==0: print("Yeah") else: print("Nope") else: print("Nope") However, you rarely do this. Using and/or etc is much better. It's all explained in the tutorial. Please complete it.
13th Feb 2020, 7:10 PM
XXX
XXX - avatar