Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. This question practices the use of a list method. Assign to the variable grades a list of 10 letteir grades from among 'A', 'B',

image text in transcribed

1. This question practices the use of a list method. Assign to the variable grades a list of 10 letteir grades from among 'A', 'B', 'C', 'D', and 'F'. For example: grades['A, 'F', "C', 'F', 'A, 'B', 'A, C Write a Python expression that creates a list named frequency, in which the elements are the number of times each of the letters A, B, C, D and F appear in grades. For example, for the above value of grades, the following would be correct output: frequency-[4, 2, 2, 0, 2] Your expression must give the correct values for any list of grades, not just the one in your list. Hint: use the list method count. This question practices list membership, list indexes and list slices. 2. a. Write a Python statement that creates a list named dog_breeds that contains the elements b. Write a Python statement that uses list slicing to create a list herding_dogs that is made up of c. Write a Python statement that uses list indexing to create a list tiny_dogs that is made up of d. Write a Python statement that tests whether 'Persian' is in the list dog_breeds and prints collie', 'sheepdog', 'Chow', and 'Chihuahua in the order given. the first two elements of dog_breeds. the last element of dog_breeds. either True or False depending on the

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

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions

Question

How is Karen Slagles argument an example of confirmation bias?

Answered: 1 week ago

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago