A statement is a unit of code that the Python interpreter can execute .

Example:

Example - Teachoo.jpg

Input and Output statement

In Python, we have the input() function for taking the user input . The input() function prompts the user to enter data. It accepts all user input as string . The user may enter a number or a string but the input() function treats them as strings only. 

The syntax for input() is: 

input ([Prompt])

Example:

Example 1 - Teachoo.jpg

Python uses the print() function to output data to the screen.The function print() evaluates the expression before displaying it on the screen. The print() outputs a complete line and then moves to the next line for subsequent output. 

The syntax for print() is: 

print(value) 

Example:

Example 2 - Teachoo.jpg

Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class

Ask a doubt
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 13 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.