Skip to content

Commit ad33543

Browse files
committed
Added lesson 9
1 parent 0aaadb8 commit ad33543

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,4 @@
6262
- 🔗 [Chapter 6 - Lists & Tuples](https://github.com/gitdagray/python-course/tree/main/lesson06)
6363
- 🔗 [Chapter 7 - Dictionaries & Sets](https://github.com/gitdagray/python-course/tree/main/lesson07)
6464
- 🔗 [Chapter 8 - While Loops & For Loops](https://github.com/gitdagray/python-course/tree/main/lesson08)
65+
- 🔗 [Chapter 9 - Functions](https://github.com/gitdagray/python-course/tree/main/lesson09)

lesson09/functions.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
def hello_world():
2+
print("Hello world!")
3+
4+
5+
hello_world()
6+
7+
8+
def sum(num1=0, num2=0):
9+
if (type(num1) is not int or type(num2) is not int):
10+
return 0
11+
return num1 + num2
12+
13+
14+
total = sum(7, 2)
15+
print(total)
16+
17+
18+
def multiple_items(*args):
19+
print(args)
20+
print(type(args))
21+
22+
23+
multiple_items("Dave", "John", "Sara")
24+
25+
26+
def mult_named_items(**kwargs):
27+
print(kwargs)
28+
print(type(kwargs))
29+
30+
31+
mult_named_items(first="Dave", last="Gray")

0 commit comments

Comments
 (0)