Added task 3

This commit is contained in:
2024-12-21 23:50:13 +02:00
parent 94318de22d
commit 82ac1fcf4d
7 changed files with 133 additions and 0 deletions

View 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()