fejezet 5
This commit is contained in:
13
atfogo/atfogo.py
Normal file
13
atfogo/atfogo.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import math
|
||||
|
||||
def atfogo(b1, b2):
|
||||
a = int(b1)
|
||||
b = int(b2)
|
||||
a *= a
|
||||
b *= b
|
||||
c = math.sqrt(a+b)
|
||||
return c
|
||||
|
||||
|
||||
|
||||
print(atfogo(2,3))
|
||||
24
derekszog/derekszog.py
Normal file
24
derekszog/derekszog.py
Normal file
@@ -0,0 +1,24 @@
|
||||
def derekszogu_e(a,b,c):
|
||||
derekszog = False
|
||||
|
||||
a = int(a)
|
||||
b = int(b)
|
||||
c = int(c)
|
||||
|
||||
oldalak = [a,b,c]
|
||||
print(oldalak)
|
||||
|
||||
oldalak.sort()
|
||||
print(oldalak)
|
||||
|
||||
oldalak[0] *= oldalak[0]
|
||||
oldalak[1] *= oldalak[1]
|
||||
oldalak[2] *= oldalak[2]
|
||||
print(oldalak)
|
||||
|
||||
if(oldalak[0] + oldalak[1] == oldalak[2]):
|
||||
derekszog = True
|
||||
|
||||
return derekszog
|
||||
|
||||
print(derekszogu_e(4,3,5))
|
||||
Reference in New Issue
Block a user