Python and please explain the code and function
2. (15 points, 3 each) Show the output produced by (read the code carefully): Output Output def addNums(a, b, c = 1): sum abc

2. (15 points, 3 each) Show the output produced by (read the code carefully): Output Output def addNums(a, b, c = 1): sum abc = a b c d if sum abc 100: return sum_abc, ‘huge if sum abc % 2 !=0: return sum abc, ‘odd’ return sum abc, ‘undefined’ x, y, z, d = 2, 3, 25, 2 rl, 12 – addNums(1,2) print ((I)-‘,r,r2) rl, 12 – addNums(x, y, c-9) print ((2) – 11, 12) rl, 12 = addNums(x, 17, c-84) print ((3) – rl, 12) r1, 12 – addNums(x, z, c = y) print(‘(4) -, 12, rl) rl, 12 – addNums(x, 2*3, c-2) print(‘(5) – r1, 12)



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *