FIT1045 Lecture 3: Week 3 Functions

50 views3 pages
Decomposition+!"#$"%&'()%*+$,(-*.(-%(/0%(1/$"'+#$02
3()4%56+$7(,#-$('*%(&4#)8%9(+$'#(0'%&0:(-*+"*("5$('*%$()%(+$,+;+,/588.('4%5'%,(
50(5(&4#)8%9().(+'0%81
<+9&8+1+%0(&4#"%00
=
>88#-0(,+11(&&8('#(-#46(#$(,+11(&54'0(#1(&4#)8%9
=
Functions
>88#-0(/0('#()4%56(5$(587#4+'*9(,#-$(+$'#(&54'0(-*%4%(%5"*(&54'("#44%0&#$,0(
'#(5(1/$"'+#$
Names
Input
Remarks
Function
?
?@A
B4+$'@"*5$7%@
4%'/4$(;58/%0
C4#6%$(,#-$(&54'0(#1(5$(
587#4+'*9
Algorithm
?
?@A
?
C+7(&4#)8%9('*5'(+0(,+;+,%,
def <function name> (<parameter>):
print('Hello ' + name + '!')
print('Welcome to FIT1045!')
return ('Hello ' + name + '! Welcome to FIT1045!')
<function name> (<parameter value>)
<variable name> = "Bob"
<function name> (<variable name>)
D"5$$#'(*5;%(+$,%$'E
F5$(#$8.("*5$7%(9/'5)8%(&5459%'%40
File-reading+function
Swapping+variables
G0%('%9&
H4(4%'/4$(1/$"'+#$0(5$,(5(;54+5)8%
Week$3:$Functions
</$,5.:(IJ(>/7/0'(KLIM
INOPQ
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents