diff --git a/fejezet 6/f1/f1.py b/fejezet 6/f1/f1.py new file mode 100644 index 0000000..0d0a49b --- /dev/null +++ b/fejezet 6/f1/f1.py @@ -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)) diff --git a/fejezet 6/f11/f11.py b/fejezet 6/f11/f11.py new file mode 100644 index 0000000..faf3a77 --- /dev/null +++ b/fejezet 6/f11/f11.py @@ -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)) \ No newline at end of file diff --git a/fejezet 6/f12/f12.py b/fejezet 6/f12/f12.py new file mode 100644 index 0000000..2077295 --- /dev/null +++ b/fejezet 6/f12/f12.py @@ -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)) \ No newline at end of file diff --git a/fejezet 6/f13/f13.py b/fejezet 6/f13/f13.py new file mode 100644 index 0000000..4b62cae --- /dev/null +++ b/fejezet 6/f13/f13.py @@ -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 \ No newline at end of file diff --git a/fejezet 6/f14/f14.py b/fejezet 6/f14/f14.py new file mode 100644 index 0000000..f2d5118 --- /dev/null +++ b/fejezet 6/f14/f14.py @@ -0,0 +1,9 @@ +szam = int(input()) + +def paros_e(szam): + if(szam % 2 == 0): + return True + else: + return False + +print(paros_e(szam)) \ No newline at end of file diff --git a/fejezet 6/f15/f15.py b/fejezet 6/f15/f15.py new file mode 100644 index 0000000..5194812 --- /dev/null +++ b/fejezet 6/f15/f15.py @@ -0,0 +1,9 @@ +szam = int(input()) + +def paratlan_e(szam): + if(szam % 2 == 0): + return False + else: + return True + +print(paratlan_e(szam)) \ No newline at end of file diff --git a/fejezet 6/f17/f17.py b/fejezet 6/f17/f17.py new file mode 100644 index 0000000..fb7bc9d --- /dev/null +++ b/fejezet 6/f17/f17.py @@ -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)) \ No newline at end of file diff --git a/fejezet 6/f18/f18.py b/fejezet 6/f18/f18.py new file mode 100644 index 0000000..950df04 --- /dev/null +++ b/fejezet 6/f18/f18.py @@ -0,0 +1,7 @@ +fahrenheit = int(input()) + +def celsiusra(fahrenheit): + celsius = fahrenheit / 33.8 + return celsius + +print(celsiusra(fahrenheit)) \ No newline at end of file diff --git a/fejezet 6/f19/f19.py b/fejezet 6/f19/f19.py new file mode 100644 index 0000000..eabb6ee --- /dev/null +++ b/fejezet 6/f19/f19.py @@ -0,0 +1,7 @@ +celsius = int(input()) + +def celsiusrol(celsius): + fahrenheit = celsius * 33.8 + return fahrenheit + +print(celsiusrol(celsius)) \ No newline at end of file diff --git a/fejezet 6/f2/f2.py b/fejezet 6/f2/f2.py new file mode 100644 index 0000000..bba83de --- /dev/null +++ b/fejezet 6/f2/f2.py @@ -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)) \ No newline at end of file diff --git a/fejezet 6/f3/f3.py b/fejezet 6/f3/f3.py new file mode 100644 index 0000000..9b0ec70 --- /dev/null +++ b/fejezet 6/f3/f3.py @@ -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)) \ No newline at end of file diff --git a/fejezet 6/f4/f4.py b/fejezet 6/f4/f4.py new file mode 100644 index 0000000..b735164 --- /dev/null +++ b/fejezet 6/f4/f4.py @@ -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)) \ No newline at end of file diff --git a/fejezet 6/f5/f5.py b/fejezet 6/f5/f5.py new file mode 100644 index 0000000..b735164 --- /dev/null +++ b/fejezet 6/f5/f5.py @@ -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)) \ No newline at end of file diff --git a/fejezet 6/f6/f6.py b/fejezet 6/f6/f6.py new file mode 100644 index 0000000..83af330 --- /dev/null +++ b/fejezet 6/f6/f6.py @@ -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)) \ No newline at end of file diff --git a/fejezet 6/f7/f7.py b/fejezet 6/f7/f7.py new file mode 100644 index 0000000..1fb0524 --- /dev/null +++ b/fejezet 6/f7/f7.py @@ -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)) + \ No newline at end of file