0% found this document useful (0 votes)
13 views2 pages

Input Function

Uploaded by

ssstutuorial
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Input Function

Uploaded by

ssstutuorial
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Topic: Input in python

Python input() Function


Python input() function is used to get input from the user. It prompts for the user input and reads a

line. After reading data, it converts it into a string and returns that. It throws an error EOF Error if

EOF is read.

Parameters

prompt: It is a string message which prompts for the user input

Return

It returns user input after converting into a string.

Let's see some examples of input() function to understand it's functionality.


Python input() Function Example

Example: Using input() to get user's name and age

name = input("Enter your name: ")

age = input("Enter your age: ")

print("Hello, " + name + "! You are " + age + " years
old.")
Output:

Enter you name:


Enter Your age:

You might also like