Skip to content
Snippets Groups Projects
Commit d7ae4533 authored by Daniel Moix's avatar Daniel Moix
Browse files

Week 9 Lect

parent 82b50372
Branches
No related tags found
No related merge requests found
def greet(name, timeOfDay=None):
if timeOfDay == None:
return f"Hey, {name}"
else:
return f"Good {timeOfDay}, {name}"
returnValue = greet("Bob")
print(returnValue)
returnValue = greet(timeOfDay="morning", name="Kim")
print(returnValue)
# returnValue = greet("Daisy", "afternoon")
# print(returnValue)
def positiveNegative(value):
return value, value * -1
# a1, a2 = positiveNegative(5)
# print(a1)
# print(a2)
\ No newline at end of file
def func(a, b, listC):
'''
Go away.
'''
x = 17
a = a + x
b = b - x
c[0] = x
c[1] = a
c[2] = b
print(f"In func(), the value of a is {a}")
print(f"In func(), the value of b is {b}")
print(f"In func(), the value of c is {listC}")
a = 10
b = 20
c = [0, 0, 0]
func(b, a, c)
print(f"In main, the value of a is {a}")
print(f"In main, the value of b is {b}")
print(f"In main, the value of b is {c}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment