Skip to content

Commit 2749b43

Browse files
authored
Added methods and functions
1 parent 64b7e8e commit 2749b43

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# method vs functions
2+
# a method is a function that belongs to an object
3+
'my world'.capitalize() # method example
4+
5+
6+
# functions
7+
# a function is a block of code which will execute when a function is called
8+
def add(a, b):
9+
return a + b
10+
11+
12+
print(add(12, 12))

0 commit comments

Comments
 (0)