Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.04 is overkill. Proposed changes for your review. List comprehensions. #407

Open
Dan-TEALS opened this issue Jun 27, 2022 Discussed in #370 · 0 comments
Open

4.04 is overkill. Proposed changes for your review. List comprehensions. #407

Dan-TEALS opened this issue Jun 27, 2022 Discussed in #370 · 0 comments
Assignees
Labels
Bug IntroCS.2 Medium Severity Makes the lesson hard to use but has a workaround

Comments

@Dan-TEALS
Copy link
Contributor

Discussed in #370

Originally posted by jdonwells March 16, 2022
4.04 goes through nested loops and lists a second time for 2 days. 4.03 also covers nested loops. 4.05 covers debugging nested loops. All together that is 5 days. Nested loops don't deserve that much attention in my opinion.

I moved the Tic-Tac-Toe game to Unit 3 because it doesn't need loops and it certainly doesn't need nested loops. #358 If the motivation behind 5 days of nested loops is Tic-Tac-Toe then it isn't required.

Instead I have proposed a change to 4.03 making a one day lecture and lab on nested loops and nested lists. #367

I would now like to propose changing lesson 4.04 to cover list comprehensions. List comprehensions are a vital piece of Python that we don't seem to cover.

Here is my slide show. https://docs.google.com/presentation/d/1pZHqtiT0GV-h5TIXybDXklweRxKqLloQNCTFoiOF_C8/edit?usp=sharing You may notice it references changes I made to 4.02. #365

Assignment looks like this:

Lab 4.04 - List Comprehension

Part 1

The goal of this lab is to practice using list comprehensions. Add a list comprehension to the starter code.

The functionmultiply_list(numbers, multiplier) will return a new list where each number in the numbers list will be multiplied by multiplier.

Starter Code

numbers = list(range(1,11)) # 1 to 10


def multiply_list(numbers, multiplier):
    return[] # <-- put a list comprehension here


print(numbers)
print(multiply_list(numbers, 3))

The output should look like this:

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[3, 6, 9, 12, 15, 18, 21, 24, 27, 30]
```</div>
@Dan-TEALS Dan-TEALS added Bug IntroCS.2 Medium Severity Makes the lesson hard to use but has a workaround labels Jun 27, 2022
@Dan-TEALS Dan-TEALS self-assigned this Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IntroCS.2 Medium Severity Makes the lesson hard to use but has a workaround
Projects
None yet
Development

No branches or pull requests

1 participant