Use this repository (repo, for short) to complete your practice for Lesson 2.4.
- Edpuzzle practice 🪁
- Use this for practice during the Edpuzzle video. You can use the main window or the Python Console (see button at the bottom of the PyCharm window)
- modulo 🪁
- floor division 🚁
- rounding 🪁
- absolute value 🚁
- Fix the Code #1 🪁
- Fix the code so it collects a decimal number from the user and rounds it to the hundredths place. (Note: the round function will not add decimal places!)
- Example:
- Input: 6.001
- Output: 6.00
- Example 2:
- Input: 5.672
- Output: 5.67
- GitHub will test your solution when you submit. See the instructions at the end of this page.
- Example:
- Fix the code so it collects a decimal number from the user and rounds it to the hundredths place. (Note: the round function will not add decimal places!)
- Write Code #1 🚁
- Collect two numbers from the user.
- Use the absolute value function to find the positive difference between the two numbers.
- Print a message to the user with the result.
- Example:
number1: 5 number2: 10 Output: The difference is 5.
- Fix the Code #2 🪁
- This program should find the integer quotient and the remainder when two numbers are divided.
- Prompt the user for two integers.
- Use the floor division operator and the modulo operator to find both parts of the result.
- Print a message to the user with the answer.
- Expected output (for inputs 15 and 2):
The quotient is 7 and the remainder is 1.
- Expected output (for inputs 15 and 2):
- GitHub will run a test on this when you submit it.
- When you have completed each
Attribution:
Thank you to Bianca Ruiz @RuiztheRuler for providing a great starting place for automating feedback!