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 pref():
with open("fav_song.txt", "a") as file:
user_choice = input("Enter your favorite song: ")
file.write("\n")
file.write(user_choice)
file.close()
with open("fav_genre.txt", "a") as file:
music_preference = input ("Tell me your favorite music genre: ")
file.write("\n")
file.write(music_preference)
file.close()
pref()
def answers():
user_choice = ['Yes', 'yes', 'Ok', 'ok', 'Go ahead', 'go ahead', 'Fine', 'fine', 'Please', 'please']
user_choice = input("would you like to know which favorite songs you entered before?: ")
with open("fav_song.txt", "r") as file:
for line in file:
if user_choice in line:
result = line
break
if user_choice == user_choice:
file = open('fav_song.txt', 'r')
print(file.read())
file.close()
answers()
def answers2():
good_answer = ['Yes', 'yes', 'Ok', 'ok', 'Go ahead', 'go ahead', 'Fine', 'fine', 'Please', 'please']
user_choice = input("would you like to know which favorite genres you entered before?: ")
with open("fav_genre.txt", "r") as file:
for line in file:
if user_choice in line:
result = line
break
if user_choice == user_choice:
file = open('fav_genre.txt', 'r')
print(file.read())
file.close()
answers2()