Reputation: 1
Is it possible to use quotation marks as a variable?
a = input("Insert Here")
If a is " " ":
Do something
Also, would I have to do = or Is?
Upvotes: 0
Views: 68
Reputation: 44394
If you have double quotes inside a string literal then use single quotes, or escape it.
Don't use is
unless you want to see if two references refer to the same object. To test equality use ==
, a single =
is an assignment:
a = input("Insert Here: ")
if a == '"':
Do something
Upvotes: 1
Reputation: 19618
you have two options:
'"'
"\""
Upvotes: 0