Skip to content

What does the Python input() function do | Basics

  • by

The Python input() function allows a user to insert a value into a program. It takes an input value from the user and returns a string value by default.

input(message)

Later you can convert the contents of input using any data type.

Python input() function example

Simple basic example code takes string value from the user and prints it. The input() function works in the same way as the raw_input() function.

email = input("Enter email : ")

print("To confirm, email :", email)

Output:

What does the Python input() function do

Do comment if you have any doubts and suggestions on this Python basic topic.

Note: IDE: PyCharm 2021.3.3 (Community Edition)

Windows 10

Python 3.10.1

All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.

Leave a Reply

Your email address will not be published. Required fields are marked *