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

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

1. Trace the while-loop and indicate the total trip count for the loop: total = 128 diy - 2 while total > 2: total /= div div2 print("total = 8d, div = 8d" (total, div)) Trip count - 3 2. Trace the for-loop, compute the trip count. total = 0 for target in [ 27, 9, 18, 3]: total += target/3 print("total = $d" % (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 = $" % (total)) Trip count = 5. Trace the for-loop and determine what the loop does. in str = "apple" for target in range( 0, len (in str), 1) : print (instr[target]) count + 1 print("%d" $ (count)) 6. Trace the for-loop strl - I an empty string for target in "Cnd": strl + (target + "a") print("%s" % (str1)) 7. Trace the for-loop: strl = "my dog has fleas".split(" ") '# a space delimiter for target in strl: 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!