Python Tutorial Part 5: Reading input from the keyboard, data conversion, and arithmetic

preview_player
Показать описание
In part five of this series, we talk about getting input from the user, how to convert it to numbers, and then perform basic arithmetic operations on it.

Functions discussed :

input() : prompts the user, reads and returns the response as a string
int() : converts user input from a string to a whole number
float() : converts user input from a string to a floating point number

Arithmetic operators :
+ - addition
- - subtraction
* - multiplication
/ - division
** - exponentiation

Рекомендации по теме