Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 384 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 384 Bytes

do math

Build a function, do_math, that takes in 3 parameters: num1 (number), num2 (number), and operator (string)

  • it uses the operator to determine what math to do to the numbers
    • if '+', it adds them
    • if '-', it subtracts them
    • if '*' or 'x' or 'X', it multiplies them
    • if '/', it divides them
  • if then returns the result
  • Example:
    • do_math(5,2,'*')
    • Return: 10