Input From User In Python

Python Input From User

If a user wants to interact with the computer then he will do it by giving input with the computer. In computer programming, if the user wants to interact with a computer program or want to enter a value then there is a need for a function that accepts values from the user. Python has input () function which receives value from the user.


name = input("Please enter your name? ")
print("Welcome!"+name)

# Taking number of users and do return addition of numbers

num1 = int(input("Please enter number"))
num2 = int(input("Please enter another number"))
ans = num1 + num2
print(ans)

Github:
https://github.com/asadraza825/python/blob/master/input_python.ipynb

Tags: Python, Python Programming,  Python Input function, Taking input in Python

Next Post Previous Post
No Comment
Add Comment
comment url