ΣνΜDr. Sharon's Math PlatformSyvara Learning
Question Bank › 📘 Undergraduate › Programming for Engineers › Q6

Q6 · Python: function my_trig returning multiple values with docstring

Functions 🟢 Intro Coding
Question

Define a Python function my_trig(a, b) that returns three values:

  1. out1 = sin(a) + cos(b)
  2. out2 = sin(b) + cos(a)
  3. A list [out1, out2]

Include a docstring. Call the function with a=2, b=3 and unpack all three return values into variables c, d, e. Print each.

🔒

Log in to see the worked solution

Enter your email to get started. Your first free solutions in every course unlock as soon as you verify.

Log in or sign up with email
← Previous Next →
Working…