# ------------------------------------------------------------------------------------ # Tutorial: What are arithmetic operators and how to use them. # ------------------------------------------------------------------------------------ # Arithmetic operators all you to perform mathematical calculations in Python. a = 5 b = 3 a + b # addition - adds two operands together a - b # subtraction - subtracts the right operand from the left a * b # multiplication - multiplies two operands a / b # division - divides left operand from right a % b # modulus - remainder of the division of left operand by the right a ** b # exponential - left operand raised to the power of the right a // b # floor division - division that results in whole number adjusted to the left in the number line # When doing more complicated arithmetic, brackets are useful to seperate calculations. c = 10 d = 12 (((a + b) / c) * d) # (a + b) will be performed first # ------------------------------------------------------------------------------------ # Challenge: list challenges to be completed here. minimum of one challenge per tutorial # ------------------------------------------------------------------------------------ # 1. Ask a user to input two numbers. Print these two numbers and show: # (a) the sum of the numbers # (b) the divison of the numbers (both a / b and b / a) # (c) the modulus of the numbers (both a % b and b % a)