Write python program a function basic_math that accepts 3values, operator, first value, and second value
if the operator is the string "add", add the first and secondvalue and return the result
if the operator is the string "subtract", subtract the secondvalue from the first and return the result
if the operator is the string "multiply", multiply the first andsecond value and return the result
if the operator is the string "divide", divide the first valueby the second value and return the result
if the operator is the string "exponent", take the first valueto the power of the second value and return the result
if the operator is any other string, return 0
Write python program a function basic_math that accepts 3 values, operator, first value, and second value if the operato
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am