Question: # Goal: we want a function that prints the product of two numbers given as arguments/input # Two variations: # 1) without using new variable


# Goal: we want a function that prints the product of two numbers given as arguments/input # Two variations: # 1) without using new variable # def printproduct (num1, num2): print ("The product is:", (num1 num2)) # 2) but strongly recommended for beginners: use an additional variable t hold value of computed product. Then print that value. I It's good for beginniners to get in the habit of naming values using assignment statements def printProduct (numl, num2): result - numl num2 print("The product is:", result) # Mention (and demo) that the print function can take multiple arguments and that it combines them # together, putting a spaced between items, and converting items t strings as # E.g. (, 3) prints cessary three
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
