Skip to content

Latest commit

 

History

History
executable file
·
50 lines (31 loc) · 765 Bytes

File metadata and controls

executable file
·
50 lines (31 loc) · 765 Bytes

functions

Examples in Python 3

"""
Define a simple function
"""
def test():
	print("This is a test")

test()


"""
Define a function with a parameter
"""
def test2(someText):
	print("Parameter was: " + someText)

test2("Hello world!")


"""
Define a function with a return
"""
def test3(someText, x):
	return someText * x

test_return = test3("Hello", 3)
print(test_return)

Reference and read more

Function definitions

Defining Functions

Revision history

2014-07-17 (sylvanas) PA1 First try.