Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
musicbot/artistrecommend.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
161 lines (134 sloc)
3.62 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Code by Thomas Cradock 10370302 | |
def artistPref(): | |
rockArtists = [ | |
"the scorpions", | |
"ac/dc", | |
"queen", | |
"billie idol", | |
"bon jovi", | |
"electric light orchestra (elo)", | |
"foreigner", | |
"iron maiden" | |
] | |
metalArtists = [ | |
"black sabbath", | |
"led zepplin", | |
"guns n’ roses", | |
"aerosmith", | |
"linkin park", | |
"disturbed", | |
"cradle of filth", | |
"def leppard" | |
] | |
electronicArtists = [ | |
"avicii", | |
"marshmello", | |
"swedish house mafia", | |
"skrillex", | |
"diplo", | |
"calvin harris", | |
"zedd", | |
"gorillaz" | |
] | |
countryArtists = [ | |
"carrie underwood" | |
"elvis" | |
"shania twain" | |
"tim mcgraw" | |
"chris stapleton" | |
"florida george line" | |
"john denver" | |
"keith urban" | |
] | |
classicalArtists = [ | |
"johann sebastian bach", | |
"johann pachelbel", | |
"pyotr ilyich tchaikovsky", | |
"wolfgang amadeus mozart", | |
"ludwig van beethoven", | |
"johannes brahms", | |
"antonio vivaldi", | |
"andrea bocelli" | |
] | |
popArtists = [ | |
"taylor swift" , | |
"elton john", | |
"the weeknd", | |
"shawn mendes", | |
"ariana grande", | |
"billie eilish", | |
"ed sheeran", | |
"adele", | |
] | |
indieArtists = [ | |
"arctic monkeys" | |
"glass animals" | |
"the killers" | |
"r.e.m." | |
"nirvana" | |
"oasis" | |
"florence + the machine" | |
"kaiser chiefs" | |
] | |
#lists for each music genre containing artists of that genre | |
pref = input ("Please enter an artist you like to listen to\n").lower() | |
genre = input("Please enter the genre of the artist you provided\n").lower() | |
#takes the user inputs for an artist they like and the genre of the artist so it can focus on what genre to look at | |
if genre == "rock": | |
print("I would reccommend:\n") | |
for artist in rockArtists: | |
if artist == pref: | |
continue | |
else: | |
print(artist) | |
#if statement checks the input that the user enter for the genre, then outputs the list of artists from that genre. | |
#for loop iterates through each element in the list to check if its the same as the artist the user entered | |
#if it was, it is not printed for the user to see | |
#if it was not, the element is printed | |
elif genre == "metal": | |
print("I would reccommend:\n") | |
for artist in metalArtists: | |
if artist == pref: | |
continue | |
else: | |
print(artist) | |
elif genre == "electronic": | |
print("I would reccommend:\n") | |
for artist in electronicArtists: | |
if artist == pref: | |
continue | |
else: | |
print(artist) | |
elif genre == "country": | |
print("I would reccommend:\n") | |
for artist in countryArtists: | |
if artist == pref: | |
continue | |
else: | |
print(artist) | |
elif genre == "classical": | |
print("I would reccommend:\n") | |
for artist in classicalArtists: | |
if artist == pref: | |
continue | |
else: | |
print(artist) | |
if genre == "pop": | |
print("I would reccommend:\n") | |
for artist in popArtists: | |
if artist == pref: | |
continue | |
else: | |
print(artist) | |
elif genre == "indie": | |
print("I would reccommend:\n") | |
for artist in indieArtists: | |
if artist == pref: | |
continue | |
else: | |
print(artist) | |
else: | |
print("I do not understand that genre, please try again") | |
artistPref() | |
#generic else statement for if the user input for the genre does not match one of the specified ones | |
artistPref() |