A. Taylor-Phillips A. Taylor-Phillips - 6 months ago 10
Python Question

How do I assign a string to a variable?

I need to assign a string to a variable, but I can not figure out how.
Here is my code:

s_optChoice = input(print("Enter your choice (Rock, Paper or Scizzors: "))


When I run this, I get


Enter your choice (Rock, Paper or Scizzors: None


After None, I can write my option choice, but I don't like that fact that None is printed, how can I get around this?

Answer

That's not how you ask for input. Remove print.

s_optChoice = input("Enter your choice (Rock, Paper or Scizzors: ")