You are on page 1of 3

SCHOOL OF COMPUTING, ENGINEERING & DIGITAL

TECHNOLOGIES

Python Programming (CIS1028-N)


Name
Student Number
Portfolio No. 3 – Functions

Describe the following programming terms

Function is a set of statement which re use to perform any specific


task. Some functions are builtin in the interpreter and compiler and
we can use them just by calling through class object. And some
Function time we can bult the custom functions according to the interest and
definition requirement.
without a
return value
Myfunction():
Print (“my code”)
Myfunction()

Function is a set of statement which re use to perform any specific


task. Function where we set the parameter and name of function is
Function function identification and if a function is returning any value then
definition we set the data type of return value in the function.
with a return
value Int Myfunction():
Print (“my code”)
Myfunction()

formal boundary — the identifier utilized in a strategy to represent


the worth that is passed into the technique by a guest.
Formal
parameter Def sum(a,b)
C=a+b
Print©

genuine boundary — the real worth that is passed into the


technique by a guest.
Actual
parameter A=10
B=20
Sum(a,b)

Local Nearby factors in python are those factors that are pronounced
variable inside the capability. On the other hand, they are said to
(within a characterized inside a neighbourhood scope. A client can get to a
function) nearby factor inside the capability however never outside it.

Python Programming (CIS1028-N) – ICA Element 1 Portfolio 3 1 of 2


SCHOOL OF COMPUTING, ENGINEERING & DIGITAL
TECHNOLOGIES

A=10
B=20
Def Sum(a,b)

The factors that are pronounced external the


extent of a capability are characterized as
worldwide factors in python. On the other
hand, the python worldwide factors are
Global viewed as pronounced in a worldwide
stateme extension.
nt
X=”global”
Def foo()
Print (X)

Argume Arguments are passes as the parameters in


nts the function which parameters are using in
passed the function.
by
name
(keywor Sum(int x, int y)
d)

We can pass more than one arguments in


More one function for example we have to
than calculate total bill here we have multiple
one arguments
return
value
Calculate(int print, int Quantity)

We use two type of functions in variable


Variable number of argument one in print and other is
number join with the name os.
of
argume
nts Print(‘mycode’)
Inport os

Python has an alternate approach to


addressing punctuation and default values
for capability contentions. Default values
demonstrate that the capability contention
Default will take that worth assuming no contention
argume esteem is passed during the capability call.
nts
Def Values (one value, two values =
‘one’, three values = ‘two’)
Print (one_value, one, two)

Python Programming (CIS1028-N) – ICA Element 1 Portfolio 3 2 of 2


SCHOOL OF COMPUTING, ENGINEERING & DIGITAL
TECHNOLOGIES

Python Programming (CIS1028-N) – ICA Element 1 Portfolio 3 3 of 2

You might also like