Home | | Problem Solving and Python Programming | Input and Output - Python

Chapter: Problem Solving and Python Programming : Data, Expressions, Statements

Input and Output - Python

INPUT: Input is data entered by user (end user) in the program.

INPUT AND OUTPUT

 

INPUT: Input is data entered by user (end user) in the program.

In python, input () function is available for input.

Syntax for input() is:

variable = input (“data”)

Example:

>>>  x=input("enter the name:") enter the name: george

>>>y=int(input("enter the number"))

enter the number 3

#python accepts string as default data type. conversion is required for type.

 

OUTPUT: Output can be displayed to the user using Print statement .

Syntax:

print (expression/constant/variable)

Example:

print ("Hello") Hello

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Problem Solving and Python Programming : Data, Expressions, Statements : Input and Output - Python |

Related Topics

Problem Solving and Python Programming : Data, Expressions, Statements


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.