Getting user input in Python & printing output after converting into integer by using int() function

preview_player
Показать описание

Asking user to inter data by using input() function in Python. After storing the user input in a variable we can display to user by using print() function.

By default all inputs are string data type. We can convert them to integer by using int() function. We can add two user inputs after converting each input to integer.
We can add three user inputs by using single input box and display the sum of it.
Рекомендации по теме
Комментарии
Автор

you have been blessed with the art of teaching. many thanks

thusol
Автор

Thank you so much.
You taught me something that I thought was not possible to learn.
Unfortunately I found your video too late. I wish I could find this video before submitting my assignment. 😢

marwamasoudy
Автор

What if i ask input at once like 4*5
e.g
Result= input ('what do you want to calculate')
print(Result)
so how Result would be integer 20 and not just 4*5 string.

iSalmaniac_