Using input() and raw_input()

Download python eBook

Example

Python 2.x2.3

raw_input will wait for the user to enter text and then return the result as a string.

foo = raw_input("Put a message here that asks the user for input")

In the above example foo will store whatever input the user provides.

Python 3.x3.0

input will wait for the user to enter text and then return the result as a string.

foo = input("Put a message here that asks the user for input")

In the above example foo will store whatever input the user provides.

Stats

Contributors: 4
2016-07-22
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook