Arithmetic operators · 14 / 18 Exercise Easy

Order of priority

Objective

Create a Python program that requests an integer x from the user and print the result of the following operations:

  • -6 + x * 5
  • (13-2) * x
  • (x + -2) * (20 / 10)
  • (12 + x) / (5 - 4)

Instructions

  1. Request an integer x from the user.
  2. Calculate the result of the first expression.
  3. Calculate the result of the second expression.
  4. Calculate the result of the third expression.
  5. Calculate the result of the fourth expression.
  6. Print the results of each expression on separate lines.
Input
2
Output
4
22
0.0
14.0

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise