1st pu notes

1st PUC Computer Science Chapter 7 Functions Notes | Class 11

Venkatesh A August 17, 2026 23 min read
1st PUC Computer Science Chapter 7 Functions Notes | Class 11
1st PUC / Class XI • Computer Science verakworld.com

Complete Short Notes & Exam Preparation Guide

Based on the NCERT Class XI Computer Science textbook chapter.

Exam-focused explanation • Python programs • diagrams • tables • questions

Chapter Overview

verakworld.com

As programs become complex, the number of statements increases and the program may become bulky and difficult to manage. The chapter introduces functions as a way of dividing a program into manageable parts. Functions help achieve modularity and reusability.

7.1
Introduction
7.2
Functions
7.3
User Defined Functions
7.4
Scope of a Variable
7.5
Python Standard Library

Table of Contents

verakworld.com

7.1 Introduction

verakworld.com

The textbook introduces functions through the example of a company that manufactures tents. The tent has a cylindrical part with a conical top. To determine the selling price, the program needs to:

  1. Accept the height, radius and slant height.
  2. Calculate the area of canvas required.
  3. Calculate the cost of the canvas.
  4. Calculate the net payable amount including 18% tax.
Modular Programming: The process of dividing a computer program into separate independent blocks of code or sub-problems, each having a name and specific functionality, is called modular programming.
Conical Top Cylindrical Part slant height height radius
Figure-style visual: Shape of the tent
verakworld.com

Original Program Idea Without Functions

verakworld.com

The textbook first demonstrates the complete calculation in one continuous program. The important calculations are:

# Calculate conical and cylindrical canvas areas
csa_conical = 3.14 * r * l
csa_cylindrical = 2 * 3.14 * r * h

canvas_area = csa_conical + csa_cylindrical

total_cost = unit_price * canvas_area
tax = 0.18 * total_cost
net_price = total_cost + tax
Exam Point: A long program can be divided into smaller functional blocks so that it becomes easier to read, reuse and maintain.

7.2 Functions

verakworld.com
Function: A function is a named group of instructions that performs a specific task when it is invoked or called.

After defining a function, it can be called repeatedly from different parts of a program. A function can also be called from another function. Required values can be supplied through parameters.

Function-based approach

verakworld.com
def cylindrical_area(h, r):
    return 2 * 3.14 * r * h

def conical_area(l, r):
    return 3.14 * r * l

def post_tax_price(cost):
    tax = 0.18 * cost
    return cost + tax

csa_cyl = cylindrical_area(h, r)
csa_con = conical_area(l, r)
canvas_area = csa_cyl + csa_con
total_cost = unit_price * canvas_area
net_price = post_tax_price(total_cost)
Input Cylindrical Area Conical Area Canvas Area Cost + 18% Tax Net Payable
Figure-style visual: Calculation of the cost of the tent
verakworld.com

7.2.1 Advantages of Functions

verakworld.com

1. Readability

verakworld.com

Long programs become better organised and easier to understand.

2. Reduced Code Length

verakworld.com

The same code does not need to be written repeatedly. This also helps debugging.

3. Reusability

verakworld.com

A function can be called from another function or another program.

4. Team Work

verakworld.com

Work can be divided among team members and completed in parallel.

7.3 User Defined Functions

verakworld.com
User Defined Function: A function created by the programmer to perform a task according to the programmer’s requirement is called a user defined function.

Python already provides many functions through its standard library. In addition to these, programmers can create their own functions.

7.3.1 Creating User Defined Function

verakworld.com

A user defined function definition begins with def.

def function_name([parameters]):
    statements

Important Rules

verakworld.com
  • def is used to begin a function definition.
  • Parameters enclosed in brackets are optional.
  • A function may have parameters or may have no parameters.
  • A function may return a value or may not return a value.
  • The function header ends with a colon :.
  • The function name should be unique and follow identifier naming rules.
  • Statements belonging to the function must be properly indented.
  • Statements outside the function indentation are not considered part of the function.

Function Definition and Function Call

verakworld.com
def add_numbers():
    first = int(input("Enter first number: "))
    second = int(input("Enter second number: "))
    total = first + second
    print("The sum is", total)

add_numbers()
Function Call: To execute a function, write the function name followed by parentheses. For example: add_numbers()

7.3.2 Arguments and Parameters

verakworld.com
Argument: A value passed to a function during the function call.
Parameter: The corresponding variable in the function header that receives the argument.
def sum_n(n):
    total = 0
    for i in range(1, n + 1):
        total = total + i
    print("Sum =", total)

num = int(input("Enter n: "))
sum_n(num)
Argument num = 5 Parameter n = 5 The parameter receives the value passed as the argument.
Figure-style visual: Argument and parameter refer to the same value during the call
verakworld.com
Remember: Argument is supplied at the time of function call; parameter is written in the function header.

Identity of Argument and Parameter

verakworld.com

The chapter demonstrates that before an increment operation, the argument and parameter can refer to the same value. After assigning a new value to the parameter, its identity changes.

def increase_value(num):
    print("Before:", num, id(num))
    num = num + 5
    print("After:", num, id(num))

number = int(input("Enter a number: "))
print("Argument id:", id(number))
increase_value(number)
Before Increment Argument = 8 Before Increment Parameter = 8 same value / identity After +5 Parameter = 13
Figure-style visual: ID of argument and parameter before and after increment
verakworld.com

List as an Argument

verakworld.com
def calculate_mean(values):
    total = 0
    count = 0
    for value in values:
        total = total + value
        count = count + 1
    mean = total / count
    print("The calculated mean is:", mean)

myList = [1.3, 2.4, 3.5, 6.9]
calculate_mean(myList)
The calculated mean is: 3.5250000000000004

Factorial Using an Argument

verakworld.com
def factorial_value(num):
    fact = 1
    for i in range(num, 0, -1):
        fact = fact * i
    print("Factorial of", num, "is", fact)

num = int(input("Enter the number: "))
factorial_value(num)
Enter the number: 5 Factorial of 5 is 120
Factorial: For a positive integer, multiplication can be written in either order because multiplication is commutative. For example, 5! = 5 × 4 × 3 × 2 × 1.

String as Parameters

verakworld.com

Arguments passed to a function need not always be numeric. String values can also be passed as arguments. The chapter demonstrates joining first name and last name to form a full name.

def full_name(first, last):
    name = first + " " + last
    print("Hello", name)

first = input("Enter first name: ")
last = input("Enter last name: ")
full_name(first, last)
Enter first name: Gyan Enter last name: Vardhan Hello Gyan Vardhan
Exam Point: The + operator is used to concatenate strings.

Default Parameter

verakworld.com
Default Parameter: A parameter can be assigned a pre-decided value. That value is used when the corresponding argument is not supplied during the function call.
def mixed_fraction(num, deno=1):
    remainder = num % deno

    if remainder != 0:
        quotient = int(num / deno)
        print("Mixed fraction =", quotient, "(", remainder, "/", deno, ")")
    else:
        print("The fraction evaluates to a whole number")

For example, if the function is called as mixed_fraction(9), the parameter num receives 9 and deno uses its default value 1. If a denominator is supplied, the supplied value replaces the default.

Important Rules for Default Parameters

verakworld.com
  • Arguments should correspond to parameters in the same order.
  • An argument may also be an expression.
  • Default parameters must be trailing parameters.
  • If a parameter has a default value, parameters to its right must also have default values.
Function HeaderStatus
def mixedFraction(num, deno=1): Valid
def mixedFraction(num=2, deno=1): Valid
def calcInterest(principal=1000, rate, time=5): Incorrect because a non-default parameter occurs after a default parameter.
def calcInterest(rate, principal=1000, time=5): Correct arrangement.

7.3.3 Functions Returning Value

verakworld.com
return statement: It sends control back to the calling function and can return a value or None.

A function may or may not return a value. Functions that perform calculations and only display results without returning a value are described in the chapter as void functions.

Function with Return Value

verakworld.com
def calculate_power(number, power):
    result = 1

    for i in range(1, power + 1):
        result = result * number

    return result

base = int(input("Enter the Base: "))
expo = int(input("Enter the Exponent: "))

answer = calculate_power(base, expo)

print(base, "raised to the power", expo, "is", answer)
Enter the Base: 5 Enter the Exponent: 4 5 raised to the power 4 is 625

Four Function Forms

verakworld.com
TypeArgumentReturn Value
1No argumentNo return value
2No argumentWith return value(s)
3With argument(s)No return value
4With argument(s)With return value(s)

Returning Multiple Values

verakworld.com

A function can return multiple values through a tuple. The chapter demonstrates returning the area and perimeter of a rectangle.

def rectangle_values(length, breadth):
    area = length * breadth
    perimeter = 2 * (length + breadth)
    return (area, perimeter)

l = float(input("Enter length: "))
b = float(input("Enter breadth: "))

area, perimeter = rectangle_values(l, b)

print("Area is:", area)
print("Perimeter is:", perimeter)
Enter length: 45 Enter breadth: 66 Area is: 2970.0 Perimeter is: 222.0
Important: Multiple values in Python can be returned through a tuple.

7.3.4 Flow of Execution

verakworld.com
Flow of Execution: The order in which the statements in a program are executed.

The Python interpreter starts from the first statement and normally executes statements from top to bottom. However, when it encounters a function definition, the statements inside that function are not executed until the function is called. When a function call is reached, control moves to the called function, executes it, and then returns to the point of the call.

Start program Function definition Function call encountered Execute function Return to the point of function call and continue
Figure-style flow of execution
verakworld.com
Common Error: A function call must not occur before the interpreter has encountered the function definition. If the call appears before the definition, a NameError can occur because the function name is not yet defined.
# Correct order
def helloPython():
    print("I love Programming")

helloPython()

Order of Execution Illustration

verakworld.com
Example 1
def Greetings(Name):
    print("Hello " + Name)

Greetings("John")
print("Thanks")

Execution order: function definition is processed, then the function call executes the function body, followed by the final print.

Example 2
def RectangleArea(l,b):
    return l*b

l = input("Length: ")
b = input("Breadth: ")

Area = RectangleArea(l,b)
print(Area)
print("thanks")

The input statements execute before the function call; control enters the function when the call is reached and then returns.

7.4 Scope of a Variable

verakworld.com
Scope: The part of a program where a variable is accessible is called the scope of that variable.

The chapter describes two scopes:

Variable Scope Global Scope Local Scope
Figure-style visual: Scope of a variable
verakworld.com

Global Variable

verakworld.com
A variable defined outside any function or block is called a global variable. It can be accessed in functions defined afterwards.

Local Variable

verakworld.com
A variable defined inside a function or block is called a local variable. It can be accessed only in that function or block and exists while that function is executing.

Example of Global and Local Variables

verakworld.com
num = 5

def my_function():
    local_value = num + 5
    print("Global value:", num)
    print("Local value:", local_value)

my_function()

print("Global outside:", num)
A local variable cannot normally be accessed outside the function in which it is defined. Trying to access it outside its scope can produce a NameError.

Using the global Keyword

verakworld.com

If a function needs to modify a global variable and use the modified value outside the function, the keyword global is used before the variable name inside the function.

num = 5

def update_number():
    global num
    print("Accessing num =", num)
    num = 10
    print("num reassigned =", num)

update_number()
print("Accessing num outside function =", num)
Accessing num = 5 num reassigned = 10 Accessing num outside function = 10
Global VariableLocal Variable
Defined outside a particular function or block. Defined inside a function or block.
Can be accessed in applicable functions. Can be accessed only within its scope.
Changes can affect functions where it is used. Exists while the function/block is active.

7.5 Python Standard Library

verakworld.com
Python Standard Library: An extensive collection of built-in functions and modules that can be used in programs, saving programmers from repeatedly creating commonly used functionality.
Function User Defined Standard Library Built-in Module
Figure-style visual: Types of functions
verakworld.com

7.5.1 Built-in Functions

verakworld.com
Built-in Functions: Ready-made functions frequently used in Python programs. Their instructions are already defined in the Python interpreter.

Examples used in the chapter include input(), int() and print().

fname = input("Enter your name: ")

Here, input() receives an argument and returns a value which is stored in fname.

Categories of Built-in Functions

verakworld.com
Input / Output Datatype Conversion Mathematical Other
input()
print()
bool()
chr()
dict()
float()
int()
list()
ord()
set()
str()
tuple()
abs()
divmod()
max()
min()
pow()
sum()
__import__()
len()
range()
type()

Common Built-in Functions

verakworld.com
Function / Syntax Arguments Returns Example / Output
abs(x) Integer or floating-point number Absolute value of x abs(4) → 4
abs(-5.7) → 5.7
divmod(x,y) x and y Tuple containing quotient and remainder divmod(7,2) → (3,1)
divmod(7.5,2) → (3.0,1.5)
max(sequence)
max(x,y,z,...)
Sequence or two or more values Largest value max([1,2,3,4]) → 4
max(23,4,56) → 56
min(sequence)
min(x,y,z,...)
Sequence or two or more values Smallest value min([1,2,3,4]) → 1
min(23,4,56) → 4
pow(x,y[,z]) x, y and optional z x raised to y; with z, modular result pow(5,2) → 25.0
pow(5,2,4) → 1
sum(x[,num]) Numeric sequence and optional starting value Sum of elements; optional value is added sum([2,4,7,3]) → 16
sum([2,4,7,3],3) → 19
len(x) Sequence or dictionary Number of elements len("Patience") → 8
len([12,34,98]) → 3

7.5.2 Module

verakworld.com
Module: A Python file containing a collection of function definitions. Modules help divide complex programs and allow functions to be reused in another program.

A function is a grouping of instructions, while a module is a grouping of functions. A module is created as a Python .py file.

Importing a Module

verakworld.com
import modulename

Multiple modules can be imported using the appropriate comma-separated form.

Calling a Module Function

verakworld.com
modulename.functionname()

The function name is preceded by the module name and a dot.

Important: Python is case sensitive. Module names used in the chapter are written in lowercase.

Built-in Module: math

verakworld.com

The math module contains different mathematical functions. Many functions in this module return floating-point values.

import math
FunctionPurposeExample
math.ceil(x)Ceiling value of xmath.ceil(9.7) → 10
math.floor(x)Floor value of xmath.floor(4.5) → 4
math.fabs(x)Absolute value of xmath.fabs(-6.7) → 6.7
math.factorial(x)Factorial of positive integer xmath.factorial(5) → 120
math.fmod(x,y)x % y with the sign of xmath.fmod(4.9,2.5)
math.gcd(x,y)Greatest common divisormath.gcd(10,2) → 2
math.pow(x,y)x raised to power ymath.pow(3,2) → 9.0
math.sqrt(x)Square rootmath.sqrt(144) → 12.0
math.sin(x)Sine of x in radiansmath.sin(0) → 0

Built-in Module: random

verakworld.com

The random module contains functions used to generate random numbers.

import random
FunctionArgumentsReturnsExample
random.random() No argument Random floating-point number from 0.0 to 1.0 random.random()
random.randint(x,y) x and y integers, x ≤ y Random integer between x and y random.randint(3,7)
random.randrange(y) Positive stop value Random integer between 0 and y according to the function’s range behaviour random.randrange(5)
random.randrange(x,y) Start and stop values Random integer in the specified range random.randrange(2,7)

Built-in Module: statistics

verakworld.com

The statistics module provides functions for calculating statistics of numeric, real-valued data.

import statistics
FunctionPurposeExampleOutput
statistics.mean(x) Arithmetic mean statistics.mean([11,24,32,45,51]) 32.6
statistics.median(x) Median / middle value statistics.median([11,24,32,45,51]) 32
statistics.mode(x) Mode / most repeated value statistics.mode([11,24,11,45,11]) 11
Module Notes: The chapter states that the import statement can be written anywhere in a program, but a module needs to be imported only once. The help("module") statement can be used to obtain a list of modules, and help("math") can be used to view information about the math module.

From Statement

verakworld.com

Instead of importing an entire module, the from statement can be used to access only the required function or functions.

from modulename import functionname

from modulename import function1, function2

When a function is imported using the from statement, the module name does not need to be written before the function call.

from random import random

print(random())

from math import ceil, sqrt

value = ceil(624.7)
print(sqrt(value))
Good Programming Practice: Using only the required functions instead of importing the whole module can save memory.

Composition

verakworld.com
A programming statement in which functions or expressions depend on one another’s execution to obtain an output is called composition.
from math import ceil, sqrt

value = ceil(624.7)
answer = sqrt(value)

print(answer)

The same dependency can also be written as:

sqrt(ceil(624.7))

Other composition examples from the chapter include expressions involving input(), int(), mathematical functions and arithmetic expressions.

Docstrings

verakworld.com
Docstrings: Python documentation strings. They are multiline strings used to describe modules, functions and related program components. They are commonly placed as the first line using three double quotes.

User Defined Module: basic_math

verakworld.com
"""
basic_math Module
*****************
This module contains basic arithmetic operations
that can be carried out on numbers
"""

def addnum(x, y):
    return x + y

def subnum(x, y):
    return x - y

def multnum(x, y):
    return x * y

def divnum(x, y):
    if y == 0:
        print("Division by Zero Error")
    else:
        return x / y

Using the Module

verakworld.com
import basic_math

print(basic_math.__doc__)

a = basic_math.addnum(2,5)
print(a)

a = basic_math.subnum(2,5)
print(a)

a = basic_math.multnum(2,5)
print(a)

a = basic_math.divnum(2,5)
print(a)

a = basic_math.divnum(2,0)
__doc__: The __doc__ variable stores the docstring of a module. It can be displayed using: print(<modulename>.__doc__)

Application Example: Traffic Light Functions

verakworld.com

The chapter also demonstrates a program in which one user defined function calls another function. The traffic-light colour is checked and another function returns a value representing the colour.

def traffic_light():
    signal = input("Enter the colour of the traffic light: ")

    if signal not in ("RED", "YELLOW", "GREEN"):
        print("Please enter a valid Traffic Light colour in CAPITALS")
    else:
        value = light(signal)

        if value == 0:
            print("STOP, Your Life is Precious.")
        elif value == 1:
            print("PLEASE GO SLOW.")
        else:
            print("GO!, Thank you for being patient.")

def light(colour):
    if colour == "RED":
        return 0
    elif colour == "YELLOW":
        return 1
    else:
        return 2

traffic_light()
print("SPEED THRILLS BUT KILLS")
Enter the colour of the traffic light: YELLOW PLEASE GO SLOW. SPEED THRILLS BUT KILLS

⚡ Quick Revision

verakworld.com

Important Definitions

verakworld.com
  • Function
  • Modular programming
  • User defined function
  • Argument
  • Parameter
  • Default parameter
  • Flow of execution
  • Scope
  • Global variable
  • Local variable
  • Built-in function
  • Module
  • Composition
  • Docstring

Important Syntax

verakworld.com
def name():
    statements

def name(parameter):
    statements

return value

import module

module.function()

from module import function

Important Modules

verakworld.com
  • math
  • random
  • statistics

Function Forms

verakworld.com
  • No argument + no return
  • No argument + return
  • Argument + no return
  • Argument + return

High-Value Exam Points

verakworld.com
  • Functions provide modularity and reusability.
  • A user defined function begins with def.
  • Function header ends with a colon.
  • Arguments are values passed during a function call.
  • Parameters receive the corresponding arguments.
  • Default parameters have pre-decided values.
  • Default parameters must be trailing parameters.
  • return transfers control back to the calling function and can return a value.
  • Multiple values can be returned using a tuple.
  • A function definition should appear before its call in the program.
  • Global variables are defined outside a particular function.
  • Local variables are defined inside a function or block.
  • The global keyword is used when a function needs to modify the global variable.
  • Built-in functions are ready-made functions available in Python.
  • A module is a Python file containing function definitions.
  • import makes module functions available.
  • from can be used to import only required functions.
  • Python is case sensitive.
  • Only required functions can be imported to save memory.

Important Built-in Functions

verakworld.com
FunctionMain Use
input()Accept input
print()Display output
int()Integer conversion
float()Floating-point conversion
abs()Absolute value
divmod()Quotient and remainder
max()Largest value
min()Smallest value
pow()Power
sum()Sum of elements
len()Number of elements
range()Generates range values
type()Identifies data type

📝 Important Questions & Answers

verakworld.com
1. What is a function?
A function is a named group of instructions that performs a specific task when it is called.
2. What is modular programming?
It is the process of dividing a program into separate independent blocks or sub-problems with specific functionality.
3. What is a user defined function?
A function created by the programmer according to a specific requirement is called a user defined function.
4. What keyword is used to define a function in Python?
def
5. What is an argument?
An argument is a value passed to a function during a function call.
6. What is a parameter?
A parameter is the variable in the function header that receives the corresponding argument.
7. Differentiate between argument and parameter.
Argument: Value supplied during function call.
Parameter: Variable in the function definition that receives the value.
8. What is a default parameter?
A parameter with a pre-decided value used when its corresponding argument is not supplied.
9. What is the rule for default parameters?
Default parameters must be trailing parameters; parameters to their right must also have default values.
10. What does the return statement do?
It returns control to the calling function and can return a value or None.
11. Can a function return multiple values?
Yes. Multiple values can be returned through a tuple.
12. What is flow of execution?
It is the order in which statements in a program are executed.
13. Why should a function be defined before its call?
The interpreter must encounter the function definition before it can find and execute the function when the call is reached.
14. What is scope of a variable?
The part of a program where a variable is accessible is called its scope.
15. What is a global variable?
A variable defined outside a particular function or block is called a global variable.
16. What is a local variable?
A variable defined inside a function or block is called a local variable.
17. Which keyword is used to modify a global variable inside a function?
global
18. What are built-in functions?
They are ready-made functions frequently used in Python programs and already defined in the Python interpreter.
19. What is a module?
A module is a Python file containing a collection of function definitions.
20. Name three built-in modules discussed in the chapter.
math, random and statistics.
21. What is the syntax for importing a module?
import modulename
22. How is a function of a module called?
Using modulename.functionname().
23. What is the use of the from statement?
It imports only the required function or functions from a module.
24. What is composition?
It is a statement in which functions or expressions depend on one another’s execution to obtain an output.
25. What are docstrings?
Docstrings are multiline documentation strings used to describe modules, functions and related program components.

Difference Questions

verakworld.com
ArgumentParameter
Passed during function call.Written in function header.
Provides the value.Receives the value.
Global VariableLocal Variable
Defined outside a function/block.Defined inside a function/block.
Can be accessed in applicable functions.Accessible only within its scope.
Can be modified using the global keyword when required.Belongs to its local scope.
Built-in FunctionUser Defined Function
Already provided by Python.Created by the programmer.
Examples: input(), print(), int().Examples created with def.
importfrom
Imports the module.Imports specified function(s).
Function generally called using module name.Imported function can be called directly.

Chapter Exercise & Exam Practice

verakworld.com

The following questions are based on the exercise, activity-based questions, suggested lab exercises and case-study section of the uploaded chapter.

Error Identification

verakworld.com
  1. Identify the error in a function definition where the function expects two parameters but only one value is passed.
  2. Identify the problem when a function uses a function name that has not been imported.
  3. Identify the error caused by trying to modify a variable inside a function without correctly handling its global scope.
  4. Identify the error in a function header where a non-default parameter follows a default parameter.
  5. Identify the error in an invalid assignment involving a function call and returned value.

Conceptual Practice

verakworld.com
  1. How is math.ceil(89.7) different from math.floor(89.7)?
  2. Which function is suitable for generating random numbers between 1 and 5: random() or randint()? Give the reason.
  3. Differentiate between built-in pow() and math.pow() with an example.
  4. Show with an example how a Python function can return multiple values.
  5. Differentiate between argument and parameter with an example.
  6. Differentiate between global and local variables with an example.
  7. Does a function always return a value? Explain.

Activity-Based / Programming Practice

verakworld.com
  1. Create a login function that accepts user ID and password and handles limited wrong attempts.
  2. Create a discount program using a user defined function based on shopping amount and membership conditions.
  3. Create a learning program using functions for simple words and single-digit addition.
  4. Create a program to generate the Fibonacci sequence using functions.
  5. Create a menu-driven calculator using functions for arithmetic operations and selected mathematical functions.

Suggested Lab Exercises

verakworld.com
  1. Write a function to check divisibility of a number by 7.
  2. Write a function that accepts name and gender and prefixes an appropriate title.
  3. Write a function to calculate the determinant of a quadratic equation using b² - 4ac and classify it according to the sign of the determinant.
  4. Use the random module to automate a lucky draw from token IDs.
  5. Write a function to calculate compound interest using the given formula and parameters.
  6. Write a function that accepts two numbers, swaps them when required, and returns them.
  7. Create functions for area, perimeter or surface area of shapes such as square, rectangle, triangle, circle and cylinder and use them through a module.
  8. Create a five-question GK quiz with randomly displayed questions and functions for scoring and remarks.

Case Study Practice

verakworld.com
  1. Convert the functionality of earlier chapter programs into user defined functions.
  2. Add a function to check short attendance by calculating attendance percentage and returning an appropriate value according to the chapter’s stated condition.

Final Exam Checklist

verakworld.com

Must Know

verakworld.com
  • Function definition
  • Function call
  • Arguments and parameters
  • Default parameters
  • Return statement
  • Multiple return values

Must Understand

verakworld.com
  • Flow of execution
  • Global vs local scope
  • global keyword
  • Built-in functions
  • Modules
  • import vs from

Must Practise

verakworld.com
  • Function with arguments
  • Function with return
  • Returning tuple
  • Default parameter
  • math/random/statistics
  • User-defined module

📚 Chapter 7 — Functions

verakworld.com

Functions make programs more organised, reusable and easier to manage. For examination preparation, focus especially on definitions, syntax, arguments and parameters, default parameters, return values, flow of execution, scope, built-in functions, modules and the import/from statements.

Quick Revision + Important Questions

verakworld.com

© VerakWorld | Educational Notes

verakworld.com

Leave a Comment