is the 'input ()' function used to input an integer? And the raw_input () function is used to input a string?
1 Answer 1
input evaluates the input, while raw_input does not.
For example, capturing the input 5, returns the int 5. However, capturing the raw_input 5, returns the str '5'
answered Mar 8, 2015 at 12:05
inspectorG4dget
115k3030 gold badges159159 silver badges253253 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
- The Overflow Blog
-
- Featured on Meta
-
-
Related
Hot Network Questions
- On sums of a prime and a central binomial coefficient
- Roboman drowned himself
- What is the connection between renormalizability and renormalization group classifications?
- Would keeping all coils on be a good way to surpass the coilgun timing problem?
- How to Reorder Mesh Island Index by Z-Position (Lowest Z = Index 0) in Geometry Nodes?
- imakeidx with beamer: inconsistent absence/presence of error
- Include endowed chairs/emeritus status in recommender titles for grad apps?
- Should I disclose existence of a preprint during journal submission if the preprint is very different?
- (Stormlight) Rigged Weaponry — only do 2nd part with 1st part?
- How to change (Windows) user permissions on WINE?
- Does spectroscopy count as a measurement of electron spin?
- Book Recommendation for Vector Bundles
- What is a He shoots! He scores! word™?
- Does anyone use measures that take values in real numbers and cardinal numbers?
- Op amp open loop schematic
- Dummy variable rule for indefinite integrals?
- 60s Book. Young boy from scrap planet grows, befriends princess(?) fights bad guys, and eventually overthrows evil empire(?) but dies in the end
- The difference between /ɪ/ and /ə/ on unstressed syllable
- Do you die sooner if you retire later?
- Functions: Tonic, Subdominant, Dominant (characteristic notes)
- Can I indefinitely gain Adventure exp if I don't complete an Ascension quest that can raise my World level?
- Why did the Airbus A320 pitch down due to solar radiation recently, when a corrupted computer is voted out by the others and ignored?
- Practical guidelines for using sockets
- Sort this puzzle out
lang-py
raw_input()is used to input a string,input()is used to input danger. :)input()in Python 2 invokes theeval()function, and that can be dangerous - see Eval really is dangerous by SO member Ned Batchelder. That article covers some advanced Python concepts, but it may help you understand that usingeval()on random user input is not wise.