Ask Question
21 September, 07:11

For question 1-3, consider the following program: def tryIt (a, b = 7) return a + b

#MAIN

n = int (input ('Enter a number '))

Ans = tryIt (n) * 2

Print (ans)

1. What is output of the user enters 2?

2. What is output if the user enters - 5?

3. What is output if the user enters 7?

+4
Answers (1)
  1. 21 September, 08:03
    0
    1) 18

    2) 4

    3) 28

    Explanation:

    1) ans = tryIt (2) * 2

    = (2+7) * 2 = 18

    2) ans = tryIt (-5) * 2

    = (-5+7) * 2 = 4

    3) ans = tryIt (7) * 2

    = (7+7) * 2 = 28
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “For question 1-3, consider the following program: def tryIt (a, b = 7) return a + b #MAIN n = int (input ('Enter a number ')) Ans = tryIt ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers