256,162 views
0 votes
0 votes
define a function calcnum() that takes two integer parameters and returns the result of subtracting the product of 6 and the second parameter from the first parameter.

User Oz Solomon
by
3.3k points

1 Answer

13 votes
13 votes

Answer:

def calcnum():

num1 = int(input("Enter an integer: "))

num2 = int(input("Enter an integer: "))

num3 = (num1-6)num2

print(str(num3))

calcum()

Step-by-step explanation:

This function asks for two integers which are interpreted as strings when you ask for them so you have to turn them from strings to ints before you can do any math functions with them. After you can simply subtract 6 and num2 from the first integer and then print that value as a string.

User Meny Issakov
by
2.6k points