Changes

Jump to: navigation, search

OPS435 Python3 Lab 3

195 bytes added, 14:44, 25 September 2019
PART 1 - Function that does not take argument or return value
:#Create a new python file for testing code in this section.
:#Whenever you want to create a function, you must start with the keyword "'''def'''". The '''def''' keyword is used to start the definition of the function, and it should be followed first by the name of the function, and secondly arguments (if there is any) it expected, and finally a ":". When the python interpreter see the function declaration and its code, it does not run the code you write right wary. Functions, just like '''if''' statements, must have all code under them indented.<source lang="python">
def hello():
print('Hello World')
1,760
edits

Navigation menu