4. What is the output of this program? Your answe LIMIT 10 2sum0 3 for i in rang
ID: 3701057 • Letter: 4
Question
4. What is the output of this program? Your answe LIMIT 10 2sum0 3 for i in range (1, LIMIT 1) sum- float (-1)(i+1)/2* 5 print( 'sum of . , ?,' term(s)' , format (sum , , . 3f , ) ) 6 print () 7 print( ' surn of ''?,'term(s)', forma t (sun,..3ft)) 5. What is the output of this program, if the input is "This is a test'? 1 def main): 2 str input ('Enter a string: Your ans index = len (str) 4 print ( 'The new string is: ',string_change (str)) 5 def string change(strl): 6 nstr index len (str1) while index > 0: nstr str1l index 11 index-index 1 10 11 return nstr 12 main () 6. What is the output of this program? 1 charl - 2 char2=' ' Your answer: 3 size 6 4 for row in range (size): 5 for col in range(size): if (row>col): print (charl, end-') else: print (char2, end-) 10 print() 11 print (" InJob completed!'")Explanation / Answer
OUTPUT FOR EACH QUESTION IS AS FOLLOWS:
Q 4.
sum of 1 term(s) 0.500
sum of 2 term(s) 0.250
sum of 3 term(s) 0.375
sum of 4 term(s) 0.312
sum of 5 term(s) 0.344
sum of 6 term(s) 0.328
sum of 7 term(s) 0.336
sum of 8 term(s) 0.332
sum of 9 term(s) 0.334
sum of 10 term(s) 0.333
sum of 10 term(s) 0.333
Q 5.
The new string is: tset a si sihT
Q 6.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.