Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
def main():
singers = input("""Please choose one of theese singers/bands to know more about them:
\n Dua Lipa\n Ariana Grande\n Little Mix\n Miley Cyrus\n Tatum Rosner\n Pop Smoke\n Justin Bieber\nEnter your choice: """)
result = "No such singer" # create variable where if user enters the singers who is not on the list gives them "no such singer"
with open("Singers.txt", "r") as file:
for line in file: # to search the database in every single line
if singers.lower() in line.lower(): # if statement to see if the singer is in the line
result = line # if it is then output it if not say "no such singer"
break # to stop the loop
print(result)
good_answer = ['Yes', 'yes', 'Ok', 'ok', 'Go ahead', 'go ahead', 'Fine', 'fine', 'Please', 'please']
while input("Would you like to know more about the other artists?: ") in good_answer:
singers = input("Tell me the artists name: ")
with open("Singers.txt", "r") as file:
for line in file:
if singers.lower() in line.lower():
result = line
break
print(result)
else:
print("Have a good day!")