90% Discount Hostinger Coupon 1CODERX53
896+ Capstone Project is Available: Whatsapp: +91-7011258995, Email: sharecodepoint@gmail.com

How to taking the integer input value from user & print that value in phython

This example in on how to take the integer value from the user and print the value. I will show the simple and easy example to understand.

To taking input form the user we use input() function. Input function ask a user for some text input. If you want to taking string value from user then you use str(input()) & if you want taking input integer value from the user then use int(input()). 

Syntax : 
1. variable_name = int(input()) #syntax for taking input value

2. variable_name = str(input()) #syntax for taking string valure

3. variable_name = int(input('Enter the value ')) 
Python Code :
print('Enter the your phone number : ')
phone = int(input())
print("Your phone number : +91 -",phone)
Comment in python start with the #hastag like : #comment_line. Using #hastags you simply apply in single line but if you want add in the next line then you use again #. Hashtags comment not use for multiple line. only use single line comment.

Output :

Enter the your phone number : 
Your phone number : +91 - 7011258995

Process finished with exit code 0


Sharecodepoint is the junction where every essential thing is shared for college students in the well-defined packets of codes. We are focused on providing you the best material package like Question papers, MCQ'S, and one NIGHT STUDY MATERIAL. facebook twitter youtube instagram

Post a Comment

Previous Post Next Post

Contact Form