Exercises to Practice (Module 3)
Exercise 1
Write a Python program that accepts three numbers and displays the sum, the product, and the average.
Exercise 2
Write a Python program that accepts a student's name, class-code, and grade for three different lessons (classes) and calculates the average grade for these lessons. After you print the results in detail, please print a blank line and then, print the current date.
Exercise 3
I remember it or learn it! The square root of a number is the opposite of squaring that number. It is a value that, when multiplied by itself, gives the original number. For example, the square root of 9 is 3, because 3 x 3 = 9.
Write a Python program that accepts a number and calculates and displays its root square.
Exercise 4
I remember it or learn it! To find the percentage of a number, you can multiply the number by the percentage as a decimal. For example, to find 30% of 200, you would multiply 200 by 0.30, which equals 60. So 30% of 200 is 60.
Write a Python program that accepts the price of a super-market product without the corresponding VAT and prints the product's final price (you will have to add VAT 24%).
Exercise 5
I remember it or learn it! To find the percentage of a number, you can multiply the number by the percentage as a decimal. For example, to find 30% of 200, you would multiply 200 by 0.30, which equals 60. So 30% of 200 is 60.
Employees of Anna's company have increased their monthly salary by 13%. Write a Python program that calculates the new salary and their new annual income.
Exercise 6
Develop a Python program that originally assigns 2 random values from 1 to 100 in 2 variables. Print these values. Then write code that mutually exchanges (swaps) the values of the variables. Print again to confirm the result.
Exercise 7
Write a Python program that accepts a three-digit number and prints the sum of its digits on the screen. (Example number 543 has a sum of 12 (5 + 4 + 3)
Help: use operators % and //
Exercise 8
The formula for converting a measurement in Celsius to Fahrenheit is F = 9 / 5C +32. Write a Python program that accepts the temperature in the Celsius scale and prints on the screen the temperature in the Fahrenheit scale.
Exercise 9
Write a Python program that prints the area of a rectangular (formula: width X height)
Exercise 10
Write a Python program to print the result of the following expression: a + b / 6-4 * (a + b) +14 -b