Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

troductionYou should work with a partner for this lab. You only need to type one copy of your code. In this lab, you will learn

troductionYou should work with a partner for this lab. You only need to type one copy of your code. In this lab, you will learn some new syntax regarding lists, and you will practice using the Python programming language to solve a filtering problem. Before you leave the lab, make sure Part 2 has been checked by your instructor or TA.121.2.3.Intro to lists in Pythonlist1 is a list of strings. How can we access a single element in a list or a single character in a string? Try changing the indices from 1 to some other number to see what happens! Do negative indices work? What does list[1][1] do?How do we get the length of a list? of a string?list2 is a list of integers. What does append do? What does remove do?We can check if a value is in a list using in. We can also use boolean logic to combine various conditions (and, or, not).Filtering coursesAdd comments to explain what each line is doing. A comment in Python starts with a #.Note in particular the line that says if theCourse[0] in vowels: Can you explain what this line does? How does the program decide which courses are favourites? Would a course called Graphics be a favourite? Try adding it to the list and find out!Modify the program above so that it selects favourite courses with: names longer than 12 letters and also have the letter g in the course name.

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions