Question

Write the definition code for a function named equation, that takes three numbers, n1, n2 and...

Write the definition code for a function named equation, that takes three numbers, n1, n2 and n3 and returns the value of (n1*n22)-3n2 +n3.

Use the Python programming language

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program

def equation(n1,n2,n3):
    return (n1*pow(n2,2))-3*n2+n3
def main():
    n1= int(input("Input n1: "))
    n2=int(input("Input n2: "))
    n3=int(input("Input n3: "))
   
    result=equation(n1,n2,n3)
    print("Result =",result)
main()

Output

Input n1: 2
Input n2: 3
Input n3: 4
Result = 13

Add a comment
Know the answer?
Add Answer to:
Write the definition code for a function named equation, that takes three numbers, n1, n2 and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT