Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

r. H.Assadipour 1. What is the output of the program if the input is 10? 1 numbe

ID: 3701056 • Letter: R

Question

r. H.Assadipour 1. What is the output of the program if the input is 10? 1 number int (input('Enter a number: Your answer: 2 print('t, t sum 3sum = 0 5 for i in range (number+1): 7 sum+ i c +-1 print(c, t.i,It',sum) 2. What is the output of this program? l def main() 2 num1-0 Your answer: 4 numl, num2 get_num() 5 print ('numi num1, n') 7 8 def get_ num(): 6 print ('num2 ,num2) 10 num2=8 11 return numl, num2 12 main() 3. What is the output of this program if the inputs are 5 and 6? 1 import math 2 def main(): Your answer: 3 a float (input ('Enter value 1: ')) 4 b float (input ('Enter value 2: ')) ? = math.hypot (a, b) print ( 'Answer ' , format (c, ' .2 f' ) ) 7 main ()

Explanation / Answer

1.

('c', ' i', ' sum')
(1, ' ', 0, ' ', 0)
(2, ' ', 2, ' ', 2)
(3, ' ', 4, ' ', 6)
(4, ' ', 6, ' ', 12)
(5, ' ', 8, ' ', 20)
(6, ' ', 10, ' ', 30)

for every even no it is printed

2.

('num1=', 5, ' ')
('num2=', 8)

3.

('Answer = ', '9.43')

hypot gives sqrt(x2+y2)