ACTIVITY 29 / 50
Try as many times as you needVisit every discovery
Let’s understand
for can visit list items directly, not just numbers from range. Its variable receives the next item each time. This is useful when you do not need the item’s position.
Listen to the explanation
Example
for color in ["blue", "green"]:
print(color)Print every item in tools on a separate line using for.
I need a hint
Write for tool in tools: and use tool inside the block.
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.
Мой профиль