Input in python
18 بار بازدید -
2 سال پیش
-
The content on YouTube:
https://youtu.be/Fcr9Pf5RsJQ
The content on YouTube:
https://youtu.be/Fcr9Pf5RsJQ
The content on Instagram:
https://www.instagram.com/reel/Cocy1xyjntH/?igshid=YmMyMTA2M2Y=
The script:
The topic of this video is input in python.
For example you wanna take the elevator and move to 3rd floor, you go into the elevator and press 3 button, and it will take you to the floor.
When you wanna do something like this in programming, you have to get a data from user. We have input method in python to get data from user. It reads a line and converts it to string. So data type of input, is string even if you enter a number! So when you wanna get user's age and multiply it by 2, you have to create a variable called age and in the middle of parentheses, you type a message to show the user.
Age = int(input ("How old are ya? "))
Print("Age * 2 = " + str ( Age * 2))
2 سال پیش
در تاریخ 1401/11/20 منتشر شده
است.
18
بـار بازدید شده