0% found this document useful (0 votes)
8 views2 pages

Class 8 Chapter 6 Python Functions

This document covers Python functions, explaining their modular nature, components, and creation steps. It also discusses how to make programs interactive using the input() function and distinguishes between built-in and user-defined functions. Additionally, it includes fill-in-the-blank and multiple-choice questions to reinforce understanding of the topic.

Uploaded by

Shivani K Kakkar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Class 8 Chapter 6 Python Functions

This document covers Python functions, explaining their modular nature, components, and creation steps. It also discusses how to make programs interactive using the input() function and distinguishes between built-in and user-defined functions. Additionally, it includes fill-in-the-blank and multiple-choice questions to reinforce understanding of the topic.

Uploaded by

Shivani K Kakkar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Class VIII

Chapter – 6, PYTHON FUNCTIONS

1. Answer the following questions:


(a) Python is called a modular programming language because it allows the
use of functions to break a program into smaller, manageable pieces or
modules. This makes the code more organized, reusable, and easier to
maintain as the program grows.
(b) Components of a Python function:
1. def keyword
2. Function name
3. Parameters (arguments)
4. Colon (:) to mark the end of the function header
5. Function body (Python statements)
(c) Steps involved in creating a function:
1. Defining the function – using def, function name, parameters, and
body.
2. Calling the function – by using the function name and passing required
arguments.
(d) We can make a program interactive by using the input() function, which
allows the user to enter data while the program is running.
(e) Types of functions in Python:
1. Built-in functions – Predefined in Python (e.g., print(), input())
2. User-defined functions – Created by the programmer.

2. Fill in the blanks:


(a) User-defined function
(b) built-in
(c) input()
(d) arguments/parameters
(e) (i) Defining a function (ii) Calling a function
(f) user-defined functions
(g) def
(h) unique and easy to correlate with the task
(i) modules
(j) colon (:)

3. Tick the correct option:


(a) (i) modules
(b) (iii) def
(c) (i) :
(d) (i) arguments
(e) (iii) Defining
(f) (iv) All of these
(g) (iii) both print() and input()
(h) (i) input()
(i) (iv) User-defined
(j) (iv) All of these

You might also like