Ask Question
19 June, 05:41

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. 19 June, 06:06
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers