Giter Site home page Giter Site logo

lab-04's Introduction

CPSC 223P Lab - 04 (Lists)

In this lab you will write a Python program that does a little more advanced list manipulation.
This exercise is intended to get you introduced to some of the more powerful ways to work with lists.

Requirements

Your software file will begin several lists imported from a module "lists". You will need to use list comprehension and list pairing to iterate and edit the data in the lists. There are three different tasks to perform and here are the requirements for each

  1. Using the provided list 'school_lunches' from the lists module, your code shall use list comprehension to print out the daily menu, but substitute "bratwurst" everywhere you see "hot dog". Your code shall print the list directly so the output will include the brackets and quotations (['item 1', item 2' ... and so on])

  2. Using the provided lists, 'questions" and "answers' from the lists module, your code shall use list pairing (zip) to iterate over the two lists at the same time. Your code shall print out questions and answers in a loop. Format them: "What is your [question]? My [question] is [answer]."

  3. Using the provided list 'sports_teams' your code shall manipulate the nested lists to print all teams from New York and then all teams from Los Angeles. Just print the lists directly so the output will include the brackets and quotations (['team 1', team 2' ... and so on])

Specification

First, download the project to your local workstation. I recommend using a source code repository interface such as GitHub Desktop. Start with the template file called list_manipulation.py. Modify the header to include your own information, and update the code to meet the requirements. When you are satisfied with your changes, commit them to the repository.

After your code is committed to your GitHub repository, go to your account on GradeScope and find the assignment called Lab-04 - More Lists. Under "Submission Method" select GitHub. You will need to point to the correct repository (called something like joates-223p-spring-2021/lab-04-your user name). You may be asked to link your GitHub account with Gradescope at this time. Next select the Main branch and press Upload. Gradescope will import your project files from GitHub and automatically grade them. If you like what you see, you are done. If not, you can make changes and use the Resumbit button on the bottom right of the Gradescope page to try again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.