Arithmetic Operators: Exercises


4. Division Operator. In Python, division is performed using the / operator.

Define two variables, a=9, b=3.

Next, divide a by b and assign it to a third variable, c.

Finally, print c to the console.


# Define a and b. a = 9 ___ = 3 # Divide a by b and assign result to new variable, c. ___ # Print c. ___ # Define a and b. a = 9 b = 3 # Divide a by b and assign result to new variable, c. c = a / b # Print c. print(c) test_object("a") test_object("b") test_object("c") success_msg("Correct!")
You can use the / operator to perform division.

Previous Exercise Next Exercise