ACTIVITY 33 / 50
Try as many times as you needYour own command
Let’s understand
def defines a function with a name. Indent its body. Defining it does not run it: call the function by name with parentheses. You can reuse the same command many times.
Listen to the explanation
Example
def hello():
print("Hello")
hello()Define signal to print PING. Call it twice.
I need a hint
Put the calls signal() after the definition without indentation.
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.
Мой профиль