Question: def add ( a , b ) : return a + b def subtract ( a , b ) : return a - b def

def add(a, b): return a + b def subtract(a, b): return a - b def multiply(a, b): return a * b def divide(a, b): if b ==0: return "Cannot divide by zero." else: return a / b # Testing the functions with sample inputs print(add(5,3)) # 8 print(subtract(10,4)) # 6 print(multiply(7,2)) # 14 print(divide(12,4)) # 3.0 print(divide(8,0)) # "Cannot divide by zero."

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!