filmov
tv
Beginner Python | Mathematics, Numbers, Integers, Floats

Показать описание
Welcome to part 3 of the beginner Python tutorial. In this video we are going to take a look a few new data types including integers and float values. We also look at a few of the different mathematical operations that can be performed in Python. We look at addition performed with the + operator, subtraction performed with the - operator, multiplication performed with the * operator, integer division performed with the // operator, float division performed with the / operator and modulus performed with the % operator.
Please practice this with a few of the following exercises:
1. Print out different ways to add, subtract, multiply, integer divide, float divide and modulus to 9 (or 9.0 in the float case).
2. Print out the following equations: 3 * 3, 4 + 8, 9 // 3, 10 / 3, 5 % 3
3. Imagine what each of these is going to equal and then print them out: 5 // 3, 4 / 3, 23 / 9.
Try putting two numbers between the greater than or less than symbol. What did each of these do? Try changing the numbers and see if the output changes. What do you think these symbols are doing?
Please practice this with a few of the following exercises:
1. Print out different ways to add, subtract, multiply, integer divide, float divide and modulus to 9 (or 9.0 in the float case).
2. Print out the following equations: 3 * 3, 4 + 8, 9 // 3, 10 / 3, 5 % 3
3. Imagine what each of these is going to equal and then print them out: 5 // 3, 4 / 3, 23 / 9.
Try putting two numbers between the greater than or less than symbol. What did each of these do? Try changing the numbers and see if the output changes. What do you think these symbols are doing?