Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Andrew BoosHartig
Andrew BoosHartig
1,459 Points

I hope this will help expand your understanding of function utility slightly. (spoilers)

I hope this doesn't make things more confusing. just know you can run input inline with a function call and explicitly declare the variables at play.

def add_then_mult(num1,num2, mult):
    add = num1 + num2
    mult = add * mult
    return mult

result = add_then_mult(
    num1=int(input("Select first number: ")), 
    num2=int(input("What do you want to add to that number: ")), 
    mult=int(input("What would you like to multiply that number by: ")))

print(f"Your result is {result}")

# Musn't forget to pull it into a variable before trying to print