Skip to content

More content was added #7

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

Closed
wants to merge 4 commits into from
Closed

More content was added #7

wants to merge 4 commits into from

Conversation

luisPinedo
Copy link

More content was added to variable, lists and tuples, and loops

Copy link
Owner

@Akuli Akuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some thoughts.

@@ -100,7 +100,8 @@ Lists have a few [useful
methods](https://docs.python.org/3/tutorial/datastructures.html#more-on-lists).
Some of the most commonly used ones are append, extend and remove.
`append` adds an item to the end of a list, `extend` adds
multiple items from another list and `remove` removes an item.
multiple items from another list and `remove` removes an item.
It can also be added with the method of `insert`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you remember when you used insert last time in a real program? I almost always need append. If people need something else, it's not hard to google "python add item to beginning of list" or whatever actually needs to be done. A mention about googling these things might be good though.

>>>
>>> names.insert(len(names), "Aly")
>>> names
['wub_wub', 'RubyPinch', 'Nitori', 'Akuli', 'go|dfish', 'theelous3', 'Aly']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

>>>
```


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an explanation about how pop is different from remove? Also, I think names.pop(1) is a thing that isn't needed very often in real-world programming (like insert), but popping the last thing with names.pop() is more useful.

7
```


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most common way to nest tuples and lists is to have a list of tuples. For example, if you have names and phone numbers, it could be like [('Akuli', '123'), ('luisPinedo', '456')]. Maybe show that?

2 x 10 = 20
>>>
```

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an ## Examples section on this page? This could go there. If there isn't, you can create one.

a = 11
>>> a **= 2 # a = a ^ 2
>>> a
121
```
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this many examples? A couple examples would be good though, maybe with strings because not everyone like numbers and math.

>>>
```


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These things are best suited for "Fix this program" exercises IMO. What do you think?

This pull request was closed.
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.

2 participants