Question: 1. Trace the while-loop and indicate the total trip count for the loop: total = 128 div - 2 while total > 2 : total

 1. Trace the while-loop and indicate the total trip count for
the loop: total = 128 div - 2 while total > 2

1. Trace the while-loop and indicate the total trip count for the loop: total = 128 div - 2 while total > 2 : total /-div div +- 2 print("total = $d, div - $d" ! (total, div)) Trip count = 2. Trace the for-loop, compute the trip count. total - 0 for target in [ 27, 9, 18, 3): total += target/3 print("total - " (total) ) Trip count = 3. Determine the sequence for each: a. range( 72, 144, 12) [ b. range( -10,11,2) [_ c. range( -15, -76,-15). 4. Trace the for-loop, compute the trip count. total = 0 for target in range( 3, 13, 3): total += target print("total = $d" $ (total)) Trip count = 5. Trace the for-loop and determine what the loop does. in atr-apple for target in range( 0, len(in_str), 1) : print (in_str[target]) count + 1 print("d" (count)) 6. Trace the for-loop strl - - # an empty string for target in "Cnd": strl +- (target + "a") print("%s" 8 (str1)) 7. Trace the for-loop: strl - "my dog has fleas".split("") '# a space delimiter for target in stri: print("s" (target)) 8. Write a loop to display every other character in a string, as in "periwinkle" would print "prwnl" (indices 0, 2, 4, 6, 8)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!