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

Refactored Episode 11 "Lists": List combinations, nested lists, removing list elements #679

Closed
wants to merge 1 commit into from

Conversation

saiboxx
Copy link

@saiboxx saiboxx commented Apr 16, 2024

Includes and closes #618: Use pop() instead of del in the Lists lesson?


When working through the "Lists" episode I noticed potential for streamlining and isolating some proposed concepts.

  1. For the handling of extend, I created a separate section for merging lists.
  2. I moved the idea of nested lists to the "mixed data type list" section.
  3. I generalized the section about removing items.

Hi Carpentry Team,

As I went through the "Lists" episode, I noticed that some programming concepts are mixed or truncated in the material.

First, the section about append introduces the concepts of lists merging via extend and also the possibility of nested lists.
I extracted the existing part of extend under the general umbrella of merging lists, as I think the episode would benefit from this logical separation.
Additionally, I introduce list merging via the + operator, which is the pythonic way, often used in practice.

I moved the discussion of lists being able to have lists as items into the fitting section about mixing data types. As lists are just a data type, the possibility of lists having lists as members is just a logical conclusion.

Lastly, I tried to generalize the section about using del to remove items.
del is not the only option to remove list elements and pop is also an essential element. This was also discussed in #618.
I incorporated pop into the existing example with del.

I would be happy for feedback.
This is my first issue in this repository, so please have mercy if I have overlooked some guidelines. :)

Cheers,
Tobias

Copy link

github-actions bot commented Apr 16, 2024

Thank you!

Thank you for your pull request 😃

🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.

If you have files that automatically render output (e.g. R Markdown), then you should check for the following:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

Rendered Changes

🔍 Inspect the changes: https://github.com/swcarpentry/python-novice-gapminder/compare/md-outputs..md-outputs-PR-679

The following changes were observed in the rendered markdown documents:

 11-lists.md | 50 +++++++++++++++++++++++++++++++++++++++-----------
 md5sum.txt  |  2 +-
 2 files changed, 40 insertions(+), 12 deletions(-)
What does this mean?

If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible.

This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.

⏱️ Updated at 2024-04-19 06:57:52 +0000

github-actions bot pushed a commit that referenced this pull request Apr 19, 2024
@vahtras
Copy link
Contributor

vahtras commented Apr 30, 2024

Thank you for your suggestions. These are on a number of topics we would prefer to review separately. Please consider them separately and present them in the issue tracking system first before making a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use pop() instead of del in the Lists lesson?
2 participants