0% found this document useful (0 votes)
575 views

Chapter 8 - Functions, String in Python (Class Viii)

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
575 views

Chapter 8 - Functions, String in Python (Class Viii)

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CHAPTER 8

FUNCTIONS, STRING IN PYTHON (CLASS VIII)


QUESTION/ANSWERS

Note: Please write all the QUESTION AND ANSWERS in your theory notebook –

I. Fill in the blanks-

a. The input given to the functions referred to as arguments.


b. Function can be defined as a block of a reusable code that performs a specific task.
c. The lower function converts all uppercase letters to lowercase.
d. A consecutive sequence of characters which are enclosed or surrounded by single or double
quotes is known as string.
e. Escape sequence is used to insert special characters that are invalid in Python.
f. String Replication Operator is used to repeat the string for a given number of times.
g. Capitalize function returns a string with the first character in capital.
h. String Concatenation Operator joins two or more string into one.

II. Answer the following-

Q1. What are functions?

Ans - A function can be defined as a block of a reusable code that performs a specific task.
Functions

help us to break our program into smaller pieces or modules.

Q2. What are the different types of functions? Explain in detail.

Ans - Built-In Functions

The print() and input() belong to the category of built-in functions. We also have other built-in
functions like range(), type(), etc. The main difference between these two categories is that built-in
functions do not require to be written by us whereas a user-defined function has to be developed by
the user at the time of writing a program.

User-Defined Functions

User-defined functions are created by the user according to the need of the program. Once the user
defines a function, the user can call it in the same way as the built-in functions. User- defined
functions are divided into various categories based on the parameters and return type.

You might also like