Ask Question
22 August, 13:15

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?

+5
Answers (1)
  1. 22 August, 14:57
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers