Instructions Practice with loops Write a python program that performs the following operations. Note that if
Fantastic news! We've Found the answer you've been seeking!
Question:
Instructions
Practice with loops
Write a python program that performs the following operations. Note that if I change the input list, your program should perform the correct operation on the new list that I give it.
Use a loop to accomplish these tasks.
Task 1: Put these numbers in a list and use the * operator to find the third power each of them, putting the result in a new list (hint: use a loop):
9, 5, 8, 2, 1, 12, 3
So, the first three items of the new list should be: 729, 125, 512 ....
Task 2: Remove all occurrences of the number 20 from the following list, using only a loop, an "if" and the list access operator (no special list functions):
list1 = [5, 20, 15, 20, 25, 50, 20]
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date: