-
-
Notifications
You must be signed in to change notification settings - Fork 36k
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
feat(curriculum): New steps to teach lists #55167
base: main
Are you sure you want to change the base?
Conversation
…nto steps-for-lists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steps 10 and 11 (introducing lists and append) should be adjusted considering the new steps.
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/66694eaaeb7d253049fa7883.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/66694bfa435cef241f6f9a68.md
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/66694fc4bba24f33ca01fa5b.md
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666951d2e4b27e3a3c72ca5f.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666951d2e4b27e3a3c72ca5f.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666951d2e4b27e3a3c72ca5f.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/6669539c1379793f9cb8917c.md
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666aae6a5d30a71f1fd7749f.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666aae6a5d30a71f1fd7749f.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/66694bfa435cef241f6f9a68.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/66694eaaeb7d253049fa7883.md
Outdated
Show resolved
Hide resolved
|
||
# --description-- | ||
|
||
To add items to a list, you can write them between the parenthesis. Add the numbers `1` and `2` inside the list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I would mention again to use the comma to separate the values.
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/66694fc4bba24f33ca01fa5b.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666951d2e4b27e3a3c72ca5f.md
Outdated
Show resolved
Hide resolved
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666aae6a5d30a71f1fd7749f.md
Outdated
Show resolved
Hide resolved
print(example_list) # [4, 5, 5.5, 6, 7] | ||
``` | ||
|
||
The `my_list` list is missing the `1` now. Add it using `insert()` in the right position, then print the list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should say something more precise if we want the list to be ordered. Although is pretty intuitive.
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666ab82c874add3c95145213.md
Outdated
Show resolved
Hide resolved
|
||
fruits_list.pop(2) | ||
|
||
print(fruits_list) # ["cherry", "lemon", "apple", "orange"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm so glad you removed "tomato".
...ith-python/learn-lambda-functions-by-building-an-expense-tracker/666ab82c874add3c95145213.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Naomi <accounts+github@nhcarrigan.com> Co-authored-by: Dario-DC <105294544+Dario-DC@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new instructions look great.
I think specifying that lists are mutable would be beneficial to campers.
|
||
# --description-- | ||
|
||
Another thing you can do with bracket notation is change an element value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing you can do with bracket notation is change an element value. | |
Python lists are mutable which means that the value of the list items can be changed. | |
You can change an element's value using the bracket notation. |
Checklist:
main
branch of freeCodeCamp.Closes #55084