Added task 3
This commit is contained in:
23
basic programming/3rd task/2.py
Normal file
23
basic programming/3rd task/2.py
Normal file
@@ -0,0 +1,23 @@
|
||||
def sameType(n1: int, n2: int) -> bool:
|
||||
return (n1 % 2 == n2 % 2) # אם שניהם זוגיים או שניהם אי זוגיים
|
||||
|
||||
def main_2ex():
|
||||
n1, n2 = 2, 4
|
||||
if sameType(n1, n2):
|
||||
print(f'{n1} and {n2} are the same type')
|
||||
else:
|
||||
print(f'{n1} and {n2} are not the same type')
|
||||
|
||||
n1, n2 = 3, 7
|
||||
if sameType(n1, n2):
|
||||
print(f'{n1} and {n2} are the same type')
|
||||
else:
|
||||
print(f'{n1} and {n2} are not the same type')
|
||||
|
||||
n1, n2 = 5, 8
|
||||
if sameType(n1, n2):
|
||||
print(f'{n1} and {n2} are the same type')
|
||||
else:
|
||||
print(f'{n1} and {n2} are not the same type')
|
||||
|
||||
main_2ex()
|
||||
Reference in New Issue
Block a user