diff --git a/11.07/Homework/Main.py b/11.07/Homework/Main.py index c3bf3d7..d93615b 100644 --- a/11.07/Homework/Main.py +++ b/11.07/Homework/Main.py @@ -18,3 +18,13 @@ Output.write(f"{Lines[i]}\n" ) except: break + +newWord = ''.join([char for char in word if not (char in Blacklist or char in Blacklist.upper())]) + + +for char in word: + if not (char in Blacklist or char in Blacklist.upper(): + newWord += char + + + diff --git a/11.21/Class/02_hossz.txt b/11.21/Class/02_hossz.txt new file mode 100644 index 0000000..110b6c0 --- /dev/null +++ b/11.21/Class/02_hossz.txt @@ -0,0 +1 @@ +84:39 \ No newline at end of file diff --git a/11.21/Class/04_kedvenc_mufaj.txt b/11.21/Class/04_kedvenc_mufaj.txt new file mode 100644 index 0000000..9a24763 --- /dev/null +++ b/11.21/Class/04_kedvenc_mufaj.txt @@ -0,0 +1 @@ +POP \ No newline at end of file diff --git a/11.21/Class/05_osszegzes.txt b/11.21/Class/05_osszegzes.txt new file mode 100644 index 0000000..304beb2 --- /dev/null +++ b/11.21/Class/05_osszegzes.txt @@ -0,0 +1,16 @@ +Boney M. - 284 +Bonnie Tyler - 334 +Dragonforce - 445 +Dschinghis Khan - 460 +Foster The People - 253 +Gloryhammer - 265 +Gopnik McBlyat - 261 +Green Day - 288 +Imagine Dragons - 392 +Korpiklaani - 194 +Linkin Park - 219 +Nirvana - 279 +Powerwolf - 739 +Rick Astley - 213 +Smash Mouth - 237 +Steppenwolf - 216 diff --git a/11.21/Class/06_imagine_dragons_dalok.txt b/11.21/Class/06_imagine_dragons_dalok.txt new file mode 100644 index 0000000..71b9249 --- /dev/null +++ b/11.21/Class/06_imagine_dragons_dalok.txt @@ -0,0 +1,2 @@ +thunder +radioactive diff --git a/11.21/Class/06_powerwolf_dalok.txt b/11.21/Class/06_powerwolf_dalok.txt new file mode 100644 index 0000000..7d6e416 --- /dev/null +++ b/11.21/Class/06_powerwolf_dalok.txt @@ -0,0 +1,3 @@ +incense and iron +venom of venus +dancing with the dead diff --git a/11.21/Class/07_torolt.txt b/11.21/Class/07_torolt.txt new file mode 100644 index 0000000..d6de069 --- /dev/null +++ b/11.21/Class/07_torolt.txt @@ -0,0 +1,17 @@ +Rick Astley Never Gonna Give You Up pop 213 +Dragonforce Through the Fire and Flames metal 445 +Boney M. Rasputin pop 284 +Steppenwolf Born To Be Wild rock 216 +Powerwolf Incense and Iron metal 240 +Smash Mouth All Star rock 237 +Nirvana Smells Like Teen Spirit rock 279 +Gloryhammer The Unicorn Invasion of Dundee metal 265 +Powerwolf Venom of Venus metal 208 +Dschinghis Khan Moskau pop 275 +Dschinghis Khan Dschinghis Khan pop 185 +Bonnie Tyler Total Eclipse of the Heart pop 334 +Gopnik McBlyat Snakes In Tracksuits hardbass 261 +Foster The People Pumped Up Kicks pop 253 +Powerwolf Dancing With The Dead metal 291 +Green Day Boulevard of Broken Dreams rock 288 +Korpiklaani Ievan polkka metal 194 diff --git a/11.21/Class/Main.py b/11.21/Class/Main.py new file mode 100644 index 0000000..613c4fc --- /dev/null +++ b/11.21/Class/Main.py @@ -0,0 +1,55 @@ +def beolvas(): + with open("playlist.csv",'r') as File: + playlist = [ (lambda l : {'eloado' : l[0], "cim" : l[1], "mufaj" : l[2], "hossz" : int(l[3]) } )( line.strip().split(';') ) for line in File ] + return playlist + +def teljes_hossz(playlist): + osszeg = sum([i["hossz"] for i in playlist]) + m,s = osszeg // 60 ,osszeg % 60 + with open("02_hossz.txt","w") as File: + File.write(f"{m}:{s}") + +def leghosszabb_rockzene(playlist): + H = [i['hossz'] for i in playlist] + with open("leghosszabb_rockzene.txt",'w') as File: + File.write(playlist[H.index(max(H))]["cim"]) + +def leggyakoribb_mufaj(playlist): + mufaj = [i['mufaj'] for i in playlist] + M = {i : mufaj.count(i) for i in set(mufaj)} + count = [*M.values()] + with open("04_kedvenc_mufaj.txt","w") as File: + File.write( [ *M.keys() ][ count.index(max(count)) ].upper() ) + +def zeneket_csoportosit(playlist): + E = {} + for i in playlist: + E[i["eloado"]] = E.get(i["eloado"],0) + i["hossz"] + with open("05_osszegzes.txt","w") as File: + for eloado in sorted(E): + File.write(f"{eloado} - {E[eloado]}\n") + +def zeneket_listaz(playlist,nev): + Dalok = [i["cim"].lower() for i in playlist if i["eloado"].lower() == nev.lower()] + + with open(f"06_{nev.lower().replace(' ','_')}_dalok.txt","w") as File: + if Dalok: + for i in Dalok: + File.write(f"{i}\n") + else: + File.write("Nincs ilyen eloado a lejatszasi listaban!") + +def zeneket_torol(playlist,nevek): + with open("07_torolt.txt","w") as File: + for i in playlist: + if not i['eloado'] in nevek: + File.write(f"{i['eloado']} {i['cim']} {i['mufaj']} {i['hossz']}\n") + + +L = beolvas() +teljes_hossz(L) +leghosszabb_rockzene(L) +leggyakoribb_mufaj(L) +zeneket_csoportosit(L) +zeneket_listaz(L,"POWERWOLF") +zeneket_torol(L,["Linkin Park","Imagine Dragons"]) diff --git a/11.21/Class/leghosszabb_rockzene.txt b/11.21/Class/leghosszabb_rockzene.txt new file mode 100644 index 0000000..3fd6b15 --- /dev/null +++ b/11.21/Class/leghosszabb_rockzene.txt @@ -0,0 +1 @@ +Through the Fire and Flames \ No newline at end of file diff --git a/11.21/Class/playlist.csv b/11.21/Class/playlist.csv new file mode 100644 index 0000000..3db304e --- /dev/null +++ b/11.21/Class/playlist.csv @@ -0,0 +1,20 @@ +Rick Astley;Never Gonna Give You Up;pop;213 +Imagine Dragons;Thunder;pop;204 +Dragonforce;Through the Fire and Flames;metal;445 +Boney M.;Rasputin;pop;284 +Steppenwolf;Born To Be Wild;rock;216 +Powerwolf;Incense and Iron;metal;240 +Smash Mouth;All Star;rock;237 +Nirvana;Smells Like Teen Spirit;rock;279 +Gloryhammer;The Unicorn Invasion of Dundee;metal;265 +Powerwolf;Venom of Venus;metal;208 +Imagine Dragons;Radioactive;rock;188 +Dschinghis Khan;Moskau;pop;275 +Dschinghis Khan;Dschinghis Khan;pop;185 +Bonnie Tyler;Total Eclipse of the Heart;pop;334 +Gopnik McBlyat;Snakes In Tracksuits;hardbass;261 +Foster The People;Pumped Up Kicks;pop;253 +Linkin Park;In The End;rock;219 +Powerwolf;Dancing With The Dead;metal;291 +Green Day;Boulevard of Broken Dreams;rock;288 +Korpiklaani;Ievan polkka;metal;194