Use raw_input()
instead of input()
:
testVar = raw_input("Ask user for something.")
input()
actually evaluates the input as Python code. I suggest to never use it. raw_input()
returns the verbatim string entered by the user.
More Related Contents:
- Using quotation marks inside quotation marks
- How To Get All The Contiguous Substrings Of A String In Python?
- Most pythonic way to interleave two strings
- Split string using a newline delimiter with Python [duplicate]
- Strip spaces/tabs/newlines – python
- Python string literal concatenation
- How do I check if raw input is integer in python 2.7?
- Why python’s list slicing doesn’t produce index out of bound error? [duplicate]
- What is a clean way to convert a string percent to a float?
- pandas: replace string with another string
- What does !r do in str() and repr()?
- Byte Array to Hex String
- How can I copy a Python string?
- What does “table” in the string.translate function mean?
- What does backward-slash b do in Python?
- How to sort a dataFrame in python pandas by two or more columns?
- Python string interning
- How can I remove the ANSI escape sequences from a string in python
- Python: TypeError: cannot concatenate ‘str’ and ‘int’ objects [duplicate]
- Understanding recursion in Python
- Remove quotes from String in Python
- Find longest repetitive sequence in a string
- Extract Number from String in Python
- Python handling socket.error: [Errno 104] Connection reset by peer
- How do I split a string into a list of characters?
- Short rot13 function – Python [closed]
- How can I do a batch insert into an Oracle database using Python?
- Why doesn’t calling a string method (such as .replace) modify (mutate) the string? Why doesn’t it change unless I assign the result?
- How can I interleave or create unique permutations of two strings (without recursion)
- What are the differences between bool() and operator.truth()?