Fejezet 6
This commit is contained in:
11
fejezet 6/f1/f1.py
Normal file
11
fejezet 6/f1/f1.py
Normal file
@@ -0,0 +1,11 @@
|
||||
irany = input()
|
||||
def fordulj_orajarasi_iranyba(irany):
|
||||
if(irany == "É"):
|
||||
return "K"
|
||||
elif(irany == "K"):
|
||||
return "D"
|
||||
elif(irany == "D"):
|
||||
return "NY"
|
||||
elif(irany == "NY"):
|
||||
return "É"
|
||||
print(fordulj_orajarasi_iranyba(irany))
|
||||
9
fejezet 6/f11/f11.py
Normal file
9
fejezet 6/f11/f11.py
Normal file
@@ -0,0 +1,9 @@
|
||||
a = int(input("a"))
|
||||
b = int(input("b"))
|
||||
|
||||
def osszehasonlitas(a,b):
|
||||
if(a > b): return 1
|
||||
elif(a == b): return 0
|
||||
else: return -1
|
||||
|
||||
print(osszehasonlitas(a,b))
|
||||
11
fejezet 6/f12/f12.py
Normal file
11
fejezet 6/f12/f12.py
Normal file
@@ -0,0 +1,11 @@
|
||||
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))
|
||||
16
fejezet 6/f13/f13.py
Normal file
16
fejezet 6/f13/f13.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#v2x-v1y=v2x0-v1y0
|
||||
#(y2-y1)⋅(x-x1)=(x2-x1)⋅(y-y1)
|
||||
|
||||
x1 = int(input())
|
||||
x2 = int(input())
|
||||
y1 = int(input())
|
||||
y2 = int(input())
|
||||
|
||||
def meredekseg(x1,x2,y1,y2):
|
||||
y3 = (y2-y1)
|
||||
x3 = (x2 - x1)
|
||||
|
||||
|
||||
fel-tiz = 10
|
||||
|
||||
3harom = 3
|
||||
9
fejezet 6/f14/f14.py
Normal file
9
fejezet 6/f14/f14.py
Normal file
@@ -0,0 +1,9 @@
|
||||
szam = int(input())
|
||||
|
||||
def paros_e(szam):
|
||||
if(szam % 2 == 0):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
print(paros_e(szam))
|
||||
9
fejezet 6/f15/f15.py
Normal file
9
fejezet 6/f15/f15.py
Normal file
@@ -0,0 +1,9 @@
|
||||
szam = int(input())
|
||||
|
||||
def paratlan_e(szam):
|
||||
if(szam % 2 == 0):
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
print(paratlan_e(szam))
|
||||
11
fejezet 6/f17/f17.py
Normal file
11
fejezet 6/f17/f17.py
Normal file
@@ -0,0 +1,11 @@
|
||||
t = int(input())
|
||||
n = int(input())
|
||||
|
||||
def tobbszoros_e(t,n):
|
||||
if(t % n == 0):
|
||||
return "Töbszöröse"
|
||||
else:
|
||||
return "Nem töbszöröse"
|
||||
|
||||
|
||||
print(tobbszoros_e(t,n))
|
||||
7
fejezet 6/f18/f18.py
Normal file
7
fejezet 6/f18/f18.py
Normal file
@@ -0,0 +1,7 @@
|
||||
fahrenheit = int(input())
|
||||
|
||||
def celsiusra(fahrenheit):
|
||||
celsius = fahrenheit / 33.8
|
||||
return celsius
|
||||
|
||||
print(celsiusra(fahrenheit))
|
||||
7
fejezet 6/f19/f19.py
Normal file
7
fejezet 6/f19/f19.py
Normal file
@@ -0,0 +1,7 @@
|
||||
celsius = int(input())
|
||||
|
||||
def celsiusrol(celsius):
|
||||
fahrenheit = celsius * 33.8
|
||||
return fahrenheit
|
||||
|
||||
print(celsiusrol(celsius))
|
||||
7
fejezet 6/f2/f2.py
Normal file
7
fejezet 6/f2/f2.py
Normal file
@@ -0,0 +1,7 @@
|
||||
szam = int(input())
|
||||
napok = ["Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat", "Vasárnap"]
|
||||
|
||||
def napszam(szam):
|
||||
return napok[szam]
|
||||
|
||||
print(napszam(szam))
|
||||
11
fejezet 6/f3/f3.py
Normal file
11
fejezet 6/f3/f3.py
Normal file
@@ -0,0 +1,11 @@
|
||||
nap = input()
|
||||
napok = ["Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat", "Vasárnap"]
|
||||
|
||||
def napszam(nap, napok):
|
||||
for i in range(7):
|
||||
if(nap == napok[i]):
|
||||
szam = i+1
|
||||
break
|
||||
return szam
|
||||
|
||||
print(napszam(nap, napok))
|
||||
12
fejezet 6/f4/f4.py
Normal file
12
fejezet 6/f4/f4.py
Normal file
@@ -0,0 +1,12 @@
|
||||
nap = int(input("0 és 6 kozott"))
|
||||
eltelt_napok = int(input("Eltelt napok szama"))
|
||||
|
||||
napok = ["Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat", "Vasárnap"]
|
||||
|
||||
def milyen_nap(nap, eltelt_napok):
|
||||
print(napok[nap])
|
||||
nap += eltelt_napok
|
||||
nap %= 7
|
||||
return napok[nap]
|
||||
|
||||
print(milyen_nap(nap, eltelt_napok))
|
||||
12
fejezet 6/f5/f5.py
Normal file
12
fejezet 6/f5/f5.py
Normal file
@@ -0,0 +1,12 @@
|
||||
nap = int(input("0 és 6 kozott"))
|
||||
eltelt_napok = int(input("Eltelt napok szama"))
|
||||
|
||||
napok = ["Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat", "Vasárnap"]
|
||||
|
||||
def milyen_nap(nap, eltelt_napok):
|
||||
print(napok[nap])
|
||||
nap += eltelt_napok
|
||||
nap %= 7
|
||||
return napok[nap]
|
||||
|
||||
print(milyen_nap(nap, eltelt_napok))
|
||||
17
fejezet 6/f6/f6.py
Normal file
17
fejezet 6/f6/f6.py
Normal file
@@ -0,0 +1,17 @@
|
||||
honap = input()
|
||||
|
||||
def honap_napszam(honap):
|
||||
if(honap == "Január"): return 30
|
||||
if(honap == "Február"): return 28
|
||||
if(honap == "Március"): return 31
|
||||
if(honap == "Április"): return 30
|
||||
if(honap == "Május"): return 31
|
||||
if(honap == "Június"): return 30
|
||||
if(honap == "Július"): return 31
|
||||
if(honap == "Augusztus"): return 31
|
||||
if(honap == "Szeptember"): return 30
|
||||
if(honap == "Október"): return 30
|
||||
if(honap == "November"): return 30
|
||||
if(honap == "December"): return 31
|
||||
|
||||
print(honap_napszam(honap))
|
||||
12
fejezet 6/f7/f7.py
Normal file
12
fejezet 6/f7/f7.py
Normal file
@@ -0,0 +1,12 @@
|
||||
ora = int(input())
|
||||
perc = int(input())
|
||||
masodperc = int(input())
|
||||
|
||||
|
||||
def masodperc_valtas(ora, perc, masodperc):
|
||||
masodpercben = ora * 3600 + perc * 60 + masodperc
|
||||
return masodpercben
|
||||
|
||||
|
||||
print(masodperc_valtas(ora, perc, masodperc))
|
||||
|
||||
Reference in New Issue
Block a user