906 B
906 B
id, source_exercise_id, title, section, source_path, source_repo, source_commit, student_visible_solution, has_private_solution, skip
| id | source_exercise_id | title | section | source_path | source_repo | source_commit | student_visible_solution | has_private_solution | skip |
|---|---|---|---|---|---|---|---|---|---|
| practical-python-1.29 | 1.29 | Defining a function | 1.7 Functions | 01_Introduction/07_Functions.md | https://github.com/dabeaz-course/practical-python | 93dca856b41c61a0a0f85ae334116e4c125629ea | false | false | false |
Exercise 1.29: Defining a function
Source: Practical Python Programming,
01_Introduction/07_Functions.md.
Exercise 1.29: Defining a function
Try defining a simple function:
>>> def greeting(name):
'Issues a greeting'
print('Hello', name)
>>> greeting('Guido')
Hello Guido
>>> greeting('Paula')
Hello Paula
>>>
If the first statement of a function is a string, it serves as documentation.
Try typing a command such as help(greeting) to see it displayed.