Lecture code 10/27/2026
This commit is contained in:
parent
9f2a91d67d
commit
aad4e226c5
7 changed files with 152 additions and 0 deletions
22
lecture20261027/if03_nested_2.py
Normal file
22
lecture20261027/if03_nested_2.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
print("\nThis program demonstrate nest if\n")
|
||||
print("Insure both values > 0, preferred method")
|
||||
|
||||
data1 = 7
|
||||
data2 = 3
|
||||
|
||||
print(f"data1 = {data1}, data2 = {data2}")
|
||||
|
||||
if data1 <= 0 or data2 <=0:
|
||||
print("ERROR: data1 and data2 must greater than zero")
|
||||
exit()
|
||||
|
||||
|
||||
|
||||
print("Done")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue