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
- What literature can I read about the Janibekov effect and the intermediate axis theorem?
- How important is power loss prevention (PLP) in SSDs?
- The difference between /ɪ/ and /ə/ on unstressed syllable
- How is this ratio formula for two conducting balls true?
- Run WinSCP as FTP server
- Functions: Tonic, Subdominant, Dominant (characteristic notes)
- "Interlacing" the 8 Queens Problem
- What are CTAN package modifications that don't affect the package files and why do they happen?
- Did Lucan make an elementary blunder about the zodiac in “Pharsalia” book 3?
- How much does the "Ottomans's consent" argument of the British Museum hold regarding the Elgin Marbles?
- Short story a watcher who sleeps ten thousand years and wakes to destabilize stagnant civilization if needed 1980s or earlier
- Urgent clarification on transit and Schengen visa requirement at Milan Malpensa Airport (MXP)
- Does anyone use measures that take values in real numbers and cardinal numbers?
- Adding math kerns (aka cut-ins or staircase kerning) to OpenType math fonts
- imakeidx with beamer: inconsistent absence/presence of error
- How to Reorder Mesh Island Index by Z-Position (Lowest Z = Index 0) in Geometry Nodes?
- Metal Eletrical Back Box Keeps Stripping Threads from Screw
- BC547 datasheet, what is this graph used for?
- What physical changes to the mouth would cause problems with articulation?
- Why wasn't this `ls` bug ever fixed?
- Did around 50% of sailors die from scurvy on long voyages?
- Extreme outlier in real data
- How precise is a DVM input impedance for high-Z circuit measurements?
- MIL-STD-1275 Protection Method
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.