Lecture code 10/27/2026
This commit is contained in:
parent
9f2a91d67d
commit
aad4e226c5
7 changed files with 152 additions and 0 deletions
24
lecture20261027/if03_nested_1.py
Normal file
24
lecture20261027/if03_nested_1.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
print("\nThis program demonstrate nest if\n")
|
||||
print("Insure both values > 0, but the logic works as two separate ifs")
|
||||
|
||||
data1 = 7
|
||||
data2 = 0
|
||||
|
||||
print(f"data1 = {data1}, data2 = {data2}")
|
||||
|
||||
if data1 <= 0:
|
||||
print("data1 is less than or equal to zero")
|
||||
exit()
|
||||
|
||||
if data2 <= 0:
|
||||
print("data2 is less than or equal to zero")
|
||||
exit()
|
||||
|
||||
print("Done")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue