My task is to write a program that asks the user to enter 5 names which it stores in a list. Next, it picks one of these names at random and declares that person as the winn
I got the same error: SyntaxError: can't assign to literal when I was trying to assign multiple variables in a single line.
I was assigning the values as shown below:
score = 0, isDuplicate = None
When I shifted them to another line, it got resolved:
score = 0
isDuplicate = None
I don't know why python does not allow multiple assignments at the same line but that's how it is done.
There is one more way to asisgn it in single line ie. Separate them with a semicolon in place of comma. Check the code below:
score = 0 ; duplicate = None