We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 64b7e8e commit 2749b43Copy full SHA for 2749b43
1 file changed
Python_Basics_2/methods_vs_functions.py
@@ -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