Download presentation

Presentation is loading. Please wait.

Published byBrycen Higgason Modified over 2 years ago

1
Procedures and Functions

2
What are they? They are both blocks of code that can be reused to perform specific task. However there is a difference: Function- The word comes from mathematics. It calculates a value based on inputs. E.g. Input X Function= Multiply by 2 Output= 2X Procedure- A set of commands that can be executed in a certain order. They do not return values. E.g. run Function1 then run Function2

3
Languages can help you out Programming languages often contain built in function. These are often complex action that would otherwise take a lot of time to create by yourself. They save time and make it much simpler to code E.g. Python- input(), len(),.upper()

4
You also need to know about Parameters and Return Values Parameter- information given to a function or procedure (a numerical or other measurable factor forming one of a set that defines a system or sets the conditions of its operation) E.g. Python Return Values – Information that come out of a subroutine. Look it even says return.

Similar presentations

OK

PYTHON FUNCTIONS. What you should already know Example: f(x) = 2 * x f(3) = 6 f(3) using f() 3 is the x input parameter 6 is the output of f(3)

PYTHON FUNCTIONS. What you should already know Example: f(x) = 2 * x f(3) = 6 f(3) using f() 3 is the x input parameter 6 is the output of f(3)

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google