ACTIVITY 28 / 50
Try as many times as you needAdd a discovery
Let’s understand
A method follows an object and a dot. append adds an item at the end. remove deletes the first matching value. These methods change the list itself, so do not assign the result of append back to it.
Listen to the explanation
Example
items = ["a"]
items.append("b")
print(items)Append water to samples, then print the list.
I need a hint
samples.append("water") changes the existing list.
How to find an error
- Read the last line of the error message.
- Find the indicated line. Check quotes, parentheses and indentation.
- Change one thing and run again.
main.py
4 spaces
Your draft stays in this browser.
Result
PythonYour program’s output will appear here. Click Run.
Мой профиль