
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
What does input() function do in python?
The function input() presents a prompt to the user (the optional arg of raw_input([arg])), gets input from the user. In Python 2.x, it returns the data input by the user in a format that is interpreted by python. For example, if the user inputs "Hello", it is stored as string while if a user enters 5, it is interpreted as an int. In Python 3.x, it returns the data input by the user in string format.
For example
name = raw_input("What is your name? ") print "Hello, %s." % name
- Related Articles
- What does reload() function do in Python?
- What does raw_input() function do in python?
- What does print() function do in Python?
- What does open() function do in Python?
- What does close() function do in Python?
- What does os.pipe() function do in Python?
- What does getattr() function do in Python?
- What does hasattr() function do in Python?
- What does setattr() function do in Python?\n\n
- What does delattr() function do in Python?\n\n
- What does the repr() function do in Python Object Oriented Programming?
- What does the str() function do in Python Object Oriented Programming?
- What does the cmp() function do in Python Object Oriented Programming?
- What does the .end() function do in jQuery?
- What does a +function() { } notation do in JavaScript?

Advertisements