Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use python the answer the following questions Exercises 2 First List Loop (one that you created in lab 1 or any new list) Repeat

Please use python the answer the following questions

Exercises 2

First List Loop (one that you created in lab 1 or any new list)

Repeat First List, but this time use a loop to print out each value in the list.

First Neat List - Loop

Repeat First Neat List, but this time use a loop to print out your statements. Make sure you are writing the same sentence for all values in your list. Loops are not effective when you are trying to generate different output for each value in your list.

Your First List - Loop

Repeat Your First List, but this time use a loop to print out your message for each item in your list. Again, if you came up with different messages for each value in your list, decide on one message to repeat for each value in your list.

Exercises

Working List

Make a list that includes four careers, such as 'programmer' and 'truck driver'.

Use the list.index()function to find the index of one career in your list.

Use the infunction to show that this career is in your list.

Use the append()function to add a new career to your list.

Use the insert()function to add a new career at the beginning of the list.

Use a loop to show all the careers in your list.

Starting From Empty

Create the list you ended up with in Working List, but this time start your file with an empty list and fill it up using append()statements.

Print a statement that tells us what the first career you thought of was.

Print a statement that tells us what the last career you thought of was.

Ordered Working List

Start with the list you created in Working List.

You are going to print out the list in a number of different orders.

Each time you print the list, use a for loop rather than printing the raw list.

Print a message each time telling us what order we should see the list in.

Print the list in its original order.

Print the list in alphabetical order.

Print the list in its original order.

Print the list in reverse alphabetical order.

Print the list in its original order.

Print the list in the reverse order from what it started.

Print the list in its original order

Permanently sort the list in alphabetical order, and then print it out.

Permanently sort the list in reverse alphabetical order, and then print it out.

Ordered Numbers

Make a list of 5 numbers, in a random order.

You are going to print out the list in a number of different orders.

Each time you print the list, use a for loop rather than printing the raw list.

Print a message each time telling us what order we should see the list in.

Print the numbers in the original order.

Print the numbers in increasing order.

Print the numbers in the original order.

Print the numbers in decreasing order.

Print the numbers in their original order.

Print the numbers in the reverse order from how they started.

Print the numbers in the original order.

Permanently sort the numbers in increasing order, and then print them out.

Permanently sort the numbers in decreasing order, and then print them out.

List Lengths

Copy two or three of the lists you made from the previous exercises, or makeup two or three new lists.

Print out a series of statements that tell us how long each list is.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

Discuss the history of human resource management (HRM).

Answered: 1 week ago