0
player_name="carl"
player_name2="slayvor"
weapon_name1="axe of souls"
thislist=[player_name,"defeated",player_name2,"with",weapon_name1]

thislist can only be stored in a text file as a string

file=open("battle_log.txt","w+")
file.write(str(thislist))
file.close

file=open("battle_log.txt","r")
string=file.readline()
file.close
thislist=[string]
print(thislist[0])

it print the entire list not player_name like it should

0 Answers0