Need help with my code, trying to create a music game. I am getting a 'AttributeError: 'list' object has no attribute 'split'. Help would be appreciated.
Thanks
import random
read = open("Songs.txt", "r")
songs = read.readlines()
songlist = []
#readlines - https://stackoverflow.com/questions/38105507/when-should-i-ever-use-file-read-or-file-readlines
for i in range(len(songs)):
songlist.append(songs[i].strip('\n'))
songname = random.choice(songlist)
#https://pynative.com/python-random-choice/ - random choice
songs = songs.split()
letters = [word[0] for word in songs]
firstguess = input("Please enter your first guess for the name of the song.")
if firstguess is True:
print("Well done, you have been awarded 3 points.")
elif firstguess is False:
print("Unlucky, that answer is incorrect. Please try again to win 1 point.")
secondguess = input("Please enter your second guess for the name of the song. Last try, make sure to think before typing!")
if secondguess is True:
print("Well done, you managed to clutch 1 point.")
elif secondguess is False:
print("Unlucky, maybe you will know the next song.")