Python: can't assign to literal
My task it to write a program that asks the user to enter 5 names which it
stores in a list. Next, get it to pick one of these names at random and
declare that person as the winner. The only issue is that when i try to
run it, it says 'can't assign to literal' This is my code:
import random
1=input("Please enter name 1:")
2=int(input('Please enter name 2:'))
3=int(input('Please enter name 3:'))
4=int(input('Please enter name 4:'))
5=int(input('Please enter name 5:'))
name=random.randint(1,6)
print('Well done '+str(name)+'. You are the winner!')
Please help as i am stumped...
No comments:
Post a Comment