Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Practice with loops Write a python program that performs the following operations. Note that if I change the input list, your program should

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]

Step by Step Solution

3.40 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

Certainly Heres a Python program that accomplishes both tasks us... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Information Systems

Authors: George H. Bodnar, William S. Hopwood

11th Edition

0132871939, 978-0132871938

More Books

Students also viewed these Programming questions

Question

Review the findings of humanistic psychotherapy outcome research.

Answered: 1 week ago