Skip to content

Commit 1e22b91

Browse files
committed
Minor update
1 parent b695fc5 commit 1e22b91

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/PyApp/PyApp/functions.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import sys
22
import os
33

4+
# No function overloading in Python!
5+
46
def sum_numbers(a, b):
57
return a + b
68

@@ -18,7 +20,7 @@ def try_to_increment(a):
1820
a += 1
1921
print("Inside function a is now ", a)
2022

21-
def sum_numbers(*args): # Note we are also function overloading here, since we already have a sum_numbers() method!
23+
def sum_numbers2(*args):
2224
total = 0
2325
for arg in args:
2426
total += arg
@@ -90,8 +92,8 @@ def function_examples():
9092
print("After calling function num = ", num)
9193

9294
print("We can call functions with multiple number of arguments")
93-
print("1 + 2 + 3 = ", sum_numbers(1, 2, 3))
94-
print("1 + 2 + 3 + 4 + 5 + 6 = ", sum_numbers(1, 2, 3, 4, 5, 6))
95+
print("1 + 2 + 3 = ", sum_numbers2(1, 2, 3))
96+
print("1 + 2 + 3 + 4 + 5 + 6 = ", sum_numbers2(1, 2, 3, 4, 5, 6))
9597

9698
print("We can have functions declared within functions. It's like Turbo Pascal 6 all over again :)")
9799
outside_function()

0 commit comments

Comments
 (0)