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

Ch-03: Programming Fundamentals - Short Question Answers | PDF

The document provides a comprehensive overview of programming fundamentals for Class 11 Computer Science, covering key concepts such as computer programs, programming languages, syntax, and the differences between interactive and batch programs. It explains various programming languages, the role of compilers and interpreters, and introduces Python as a beginner-friendly language with applications in data analysis and web development. Additionally, it discusses variables, data types, operators, and common programming practices, offering examples and explanations for each topic.

Uploaded by

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

Ch-03: Programming Fundamentals - Short Question Answers | PDF

The document provides a comprehensive overview of programming fundamentals for Class 11 Computer Science, covering key concepts such as computer programs, programming languages, syntax, and the differences between interactive and batch programs. It explains various programming languages, the role of compilers and interpreters, and introduces Python as a beginner-friendly language with applications in data analysis and web development. Additionally, it discusses variables, data types, operators, and common programming practices, offering examples and explanations for each topic.

Uploaded by

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

Computer Science Class-11

Chapter
03 Programming Fundamentals
SHORT QUESTION AND ANSWERS
1. Define computer program and programmer?
Ans: A set of well-defined instructions that can be executed by a computer to solve
problem is called computer program. A computer program is written in
programming language. A person who knows how to write computer program
correctly is called programmer.
2. How does a computer program interact with the user?
Ans: The program interacts with the user by accepting input, executing instruction
of a time and delivering the result.
3. Where is a program loaded during execution?
Ans: The program is loaded into the main memory during execution.
4. Compare the execution of an interactive program and a batch program.
Ans: An interactive program is a program that requires real-time input from a user
to work. The program responds to the commands as they are provided. On the
other hand, a batch program executes a series of pre-defined commands or
tasks without user interaction during execution. These programs are designed
to execute commands automatically in a sequence.
5. Give an example of batch program?
Ans: An example of a batch program is the print jobs on a printer that line up in a
queue and are processed one by one without requiring user interaction once
the queue is set. The process stops when no more jobs are in the queue.
6. What is the use of programming language? Give three examples of
programming languages?
Ans: The programming languages are used to write computer programs. A
programming language defines the rules for writing the computer programs. A
large number of programming languages are available for writing programs.
Three examples of programming languages are Java, Python and C++.
7. What is syntax?

1|P age
Computer Science Class-11

Ans: A set of rules for writing computer programs in a programming languages is


known as syntax. All program statements must be written according to the
syntax. The syntax works as the grammar of a programming languages.
8. Do all programming languages use the same syntax?
Ans: No, each language has its own syntax. The programs written in a specific
programming language must follow its own syntax.
9. What is high level language? Write the names of five examples of high-level
languages.
Ans: A type of language that close to human languages is called high-level language.
The instructions in these languages are similar to English language such as input
and print etc. These languages are easy to understand. Five examples of high-
level languages include Python, JavaScript, Java, Ruby and C++.
10. What is machine language?
Ans: A type of language in which instructions are written in binary form is called
machine language. It is the only language that is directly understood the
computer. A program written in machine language can be executed very fast by
computer.
11. Differentiate between source code and object code?
Ans: A source code is written by the programmer in any high-level language such as
C++. It is human readable. The code that is generated by the compiler from
source code is called object code. Computer understands object code directly.
It is also known as machine code.
12. Why is a language translator needed? Write different types of language
translators?
Ans: A language translator is needed to convert high-level program into machine
language. A program written in high-level or assembly language cannot be run
on a computer directly. It must be converted into machine language using
language translator before execution. Different types of language translators
are assembler, compiler and interpreter.
13. What happens when the code is compiled?
Ans: The compiler detects syntax errors when the code is compiled. If there are no
syntax errors, it converts the code into an object file that consists of machine
language.

2|P age
Computer Science Class-11

14. What is compiling?


Ans: The process of converting source code into object code is known as compiling.
The source program cannot be compiled if it contains any syntax error. All errors
must be removed to successfully compile a source program.
15. What are syntax errors?
Ans: Syntax errors are the errors that occur when rules of programming languages
are not followed in writing the computer program. The compiler detects syntax
error. The compiler generates an error message to describe the course of error.
16. Write the difference between compiler and interpreter.
Ans: The compiler translates the entire programs written in high level language into
machine language. The interpreter translates one instruction of the program
and executes it before translating next instruction. The compiler creates an
object file but interpreter does not create an object file.
17. Name some programming languages that use a compiler?
Ans: Some examples of the programming languages that use a compiler include C,
C++, Java and Fortran.
18. Give some examples of programming languages that use an interpreter.
Ans: Some examples of the programming languages that use interpreter include
Python, JavaScript and Ruby.
19. What is Python?
Ans: Python is one of the most popular and widely used programming languages
today. It is used for data analytics, machine learning and software development.
It is a high-level, object-oriented computer language.
20. Why Python is considered a suitable programming language for beginners?
Ans: Python is considered suitable for beginners because it is very easy to read and
understand. Its syntax is very simple and similar to English. The user can easily
understand the meaning of the words such as print.
21. What are some popular web development frameworks available for Python?
Ans: Some popular Python web development frameworks include Django, Pyramid
and Flash.
22. Why do data scientists frequently use Python?

3|P age
Computer Science Class-11

Ans: Data scientists frequently use Python because it has a large number of tools and
packages for machine learning and Artificial Intelligence.
23. How is Python used in data analysis and visualization? Give example.
Ans: Python is widely used in data analysis and visualization as it provides powerful
tools to analyze data and create informative charts and graphs. For example,
Netflix uses Python to analyze user data and recommend shows or moves to
watch. An example of data visualization using Python is creating a bar chart to
sales of different products over a month.
24. Give two examples of natural language processing.
Ans: An example of natural language processing is to give command to Google Home
Assistant such as “OK Google, play my favorite playlist”. Another common
example of NLP is chatbots used by customer service on the websites.
25. What is IDE?
Ans: A software that provides a programming environment for programmers to
write and execute computer programs is known as Integrated Development
Environment (IDE). An IDE consists of different tools to help the programmer to
write, execute and test computer programs. These tools include text editors,
compilers/interpreters and debuggers.
26. What is the purpose of the interactive console in Python IDEs?
Ans: The interactive console in Python IDEs allows users to execute commands
directly and see the results immediately. It makes it easier to test and debug
code.
27. Name an online Python IDE and its primary feature.
Ans: An online Python IDE is Replit. It provides an interactive console and an easy-
to-use environment suitable for beginners.
28. What is a REPL in the context of Replit and how is it created?
Ans: A REPL (Read-Eval-Print-Loop) in Replit is an interactive programming
environment that is used to write, evaluate and execute code. It is created by
pressing the ‘Crate Repl’ button after logging into Replit.
29. Define keyword and give three examples.
Ans: Keyword has a predefined meaning and purpose in a programming language.
The meaning and purpose of a keyword is defined by the developer of the

4|P age
Computer Science Class-11

language. It can be used for some purpose for which it is defined. Three
examples of keywords are if, for and in.
30. Can the reserved words be used as variable names in Python?
Ans: No, the reserved words cannot be used as variable names in python because
they have predefined meanings.
31. What are comments? Where can comments be added in the program?
Ans: Comments are the lines of text in the program that are not executed by Python
interpreter. The comments are usually written to describe the code in natural
language such as English. The comments can be added any where in the
program.
32. Write two purpose of writing comments in the program.
Ans: Firstly, the comments allow other programmers to understand the code easily.
Secondly, the comments are notes about the code that explain its purpose. It
helps in understanding the program even after a long time.
33. What is variable? Why is it used in programs?
Ans: A variable is a named memory location. It is used to store program’s input data
and its computational results during execution. The value of variable may
change during the execution of the program. However, the name of variable
cannot be changed.
34. Write any four rules for declaring variables in Python?
Ans: The first character of variable must be a letter or underscore. The blank spaces
are not allowed in variable names. The reserved words cannot be used as
variable names. The special symbols such as % and @ cannot be used as variable
name.
35. Give any five examples of valid variable names.
Ans: Income _area total_price MaX_SPEED Marks1
36. State whether the variable names are valid or invalid? Give reason for invalid
name?
Ans: a. Age Valid
b. Int Invalid. A keyword cannot be used as variable name.
c. -on-off Invalid. A variable cannot have hyphen in it.
d. This-I Invalid. A variable cannot have hyphen in it.

5|P age
Computer Science Class-11

e. Two way Invalid. A variable cannot have spaces in it.


37. Write down the reasons of the Invalid variable names 3a and s$.
Ans: The variable name 3a is invalid because it starts with a digit. The variable name
s$ is invalid because it contains the special character $.
38. What happens if a Python variable name starts with a number?
Ans: If a Python variable name starts with a number, it will result in a syntax error.
Variable names must begin with a letter (a-z, A-Z) or an underscore (_)
39. How can you differentiate keyword from identifier?
Ans: Keyword has a predefined meaning and purpose in a programming language
such as if and for. However, an identifier is defined by the user such as variable
names etc.
40. What does it mean that Python variables are case-sensitive?
Ans: It means that Python treats variable names with different cases as different
variables. For example, Var and var are considered two separate variables in
Python.
41. What are data types? List three basic data types and its function.
Ans: The three basic data types in Python and their functions are as follows:
int: It represents integer values. For example, x=10 stores an integer value 10
in x
float: It represents floating-point values. For example, y=3.14 stores a float
value 3.14 in y.
str: it represents strings values. For examples name = “Ali” stores the text
“Ali” in name
42. What is the use of input() function in Python? Give example
Ans: The input() function in Python is used to accept input from the user during
program execution. It inputs the value from the user via keyboard and returns
the entered value as a string. The function is normally used with a variable that
stores the value entered by the user. For example, the following statement will
input a number and stores it in variable num:
num = input(“Enter a number”);
43. What types of data does the Input() function return by default()?
Ans: The input() function in Python returns data as a string by default.

6|P age
Computer Science Class-11

44. What is the purpose of print() function in Python? Give example.


Ans: The print() function in Python is used to display standard output on the screen.
It can display text or the value of the variable on the screen. The print() function
adds a newline character at the end of the output by default.
45. What is string? Give some examples.
Ans: A string is a set of characters enclosed in single quotes (‘) or double quotes (“).
It is used to represent textual data in programming. Some examples of string
are "Pakistan”, “Hello” and “Ali”.
46. What is the use of end character in print() function?
Ans: By default, the print() function adds a newline character at the end of the
output. It causes the next output to appear on the next line. The end character
can be used in print() function to change this behavior. For example, the end
character can be set to a space so that output of the next print statement
appears on the same line instead of moving to the next line.
47. What is string concatenation in Python and how does it differ from numerical
addition?
Ans: String concatenation is the process of joining two or more strings together to
form a single string. It differs from addition as it does not perform arithmetic
operation but it combines strings.
48. Why is it important to use eval() function when dealing with numerical input
in Python?
Ans: The eval() function is necessary when dealing with numerical input because the
input() function treats all input as strings. The eval() function converts the string
representation of a number into an actual numerical value such as integer or
float for further calculations.
49. What will be the output of the following code if the user inputs 3 for both
prompts? Explain why
Ans: num1 = input(“Enter a number:”);
num2 = input(“Enter another number:”);
print(num1 + num2)
The output will be 33 instead of 6. The reasons that input() function treats the
input as a string. The + operator concatenates the two strings rather than
adding them numerically.

7|P age
Computer Science Class-11

50. List the types of operators used in Python. Write briefly about any two of
them with examples.
Ans: Three types of operators in Python are arithmetic, relational and logical
operators. The arithmetic opertors are used to perform the mathematical
operation on data. Some examples of arithmetic operators are +, -, *, / and %.
The relational operators are used to compare two values and produce result as
true or false. Some examples of relational operators are >, <, <=, <=, == and !=.
51. What does the modulus operator (%) do in Python? Give example.
Ans: The modulus operator (%) returns remainder of a division.
For example: 5 % 4 will return 1.
52. What is the purpose of the integer division operator (//) in Python? Give
example.
Ans: The integer division operator (//) returns only the integral part of a division. It
discards any decimal part. For example, 5 // 4 will return 1.
53. How is exponentiation performed in Python, and what is the symbol for it?
Give example.
Ans: Exponentiation in Python is performed using ** operator. For example 2 ** 3
will return 8 that is 2 raised to the power 3.
54. What is a logical bug in Python, and how can it be detected?
Ans: A logical bug in Python is a logical error in the code that produces incorrect
results. The syntax of the code may be correct but it does not behave according
to the expectation due to the logical mistake. Logical errors usually do not crash
the program and are hard to detect.
55. How a dry-run can help to identify logical bugs in a code snippet?
Ans: The dry-run is the simplest method to detect a logical bug in the code. It is used
to execute the program on paper and keep track of the variables for each line
of the code.
56. Give the following code, what will be the final values of x and y after
execution?
Ans: x = 10
y = 20
temp = x

8|P age
Computer Science Class-11

x=y
y = temp
After execution, the value of x will be 20 and the value of y will be 10.
57. How can the assignment operator be combined with arithmetic operators in
Python?
Ans: The assignment operator can be combined with arithmetic operators to update
the value of a variable. For example, i = i + 1 can be written as i += 1,
i = i -2 as i -= 2 and i = i * 3 as i *= 3
58. What is meant by operation precedence? What is the order of operator
precedence in Python for arithmetic operations?
Ans: The order in which different types of operators in an expression are evaluation
is known as operator precedence. It is also known as hierarchy of operators.
Each operator has its own precedence level. If an expression contains different
types of operators, the operators with higher precedence are evaluated before
the operators with lower precedence. The order of precedence of arithmetic
operators are **, *, /, //, %, +, -.
59. Differentiate between assignment operator (=) and equal to operator (==).
Ans: The symbol = is an assignment operator that assigns a value to a variable. The
symbol == is a relational operator that checks if two values are equal or not.
60. What are logical operators in Python? Give examples.
Ans: The logical operators are used to combine multiple conditions or reverse a
condition. Python provides three logical operators called and operator, or
operator and not operator. Some examples are (a<50) and (b>50),
(x<50)or(y<90) and not(a>b)
61. What is the use of “and” operator? Give example.
Ans: The and operator is used to form a compound condition in which two condition
are evaluated. The conditions are given using comparison operators. The
compound condition returns true if both conditions are true. It returns false if
any one condition is false. An example of OR operator is (A>50) or (B>10)
62. What is the use of “or” operator? Give example.
Ans: The or operator is used to form a compound condition in which two conditions
are evaluated. The conditions are given using comparison operators. The

9|P age
Computer Science Class-11

compound condition returns true if any condition is true. It returns false if both
conditions are false. An example of OR operator is (A>50) or (B>50)
63. What is the use of “not” operator?
Ans: The not operator is used with single condition. It is used to reverse the result of
condition. It returns true if the condition is false and returns false if the
condition is true. An example of an operator is not (A==B).
64. Differentiate between relational and logical operators. No need to change.
Ans: The relational operators compare two values and produce result as true or false.
The logical operators combine multiple conditions or reverse a condition. The
number of relational operators is six and the number of logical operators is
three.
65. Why do we need conditional statement?
Ans: A conditional statement is needed to make decisions in programming based on
a condition. It executes a statement if the condition is true and ignore when the
condition is false. For example, a conditional statement may display “Pass” if
the marks of a student are 33 or more.
66. Describe a condition with an example.
Ans: A condition is an expression that is either true or false. A condition may consist
of arithmetic expressions, relational expressions and logical expressions. An
example of a condition is a > b that will check if the value of a is greater than b.
67. Write the structure of if statement with brief description
Ans: The structure of if statement is as follows:
if condition;
statement
The word is the keyword that represents the if statement. The given condition
will be checked and can be true or false. The statement will be executed if the
condition is true, it must be written with an indentation by pressing tab key
before the statement.
68. Differentiate between if statement and if-else statement with an example.
Ans: If statement is used to execute or skip a statement or set of statements based
on a condition. The statement is executed if condition is true. Otherwise, it is
skipped. For example:

10 | P a g e
Computer Science Class-11

if marks >= 60;


print(“You passed.”)
if-else statement is used for making two-way decisions. It executes one block of
statement(s) when the condition is true and the other when it is false. For
example:
if marks >= 60;
print(“You passed.”)
else:
print(“You did not pass.”)
69. How if-elif-else is used to handle multiple conditions?
Ans: The if-elif-else structure is used to handle multiple conditions by checking each
condition in sequence until a true condition is found. If a condition is true, the
statement following the condition is executed. The remaining blocks are
skipped. The statement after else is executed if all preceding conditions are
false.
70. How do if, elif and else statements work together in Python?
Ans: The if statement is used to check a condition and execute a block of code if the
condition is true. The elif statement allows additional conditions to be checked
if the first if condition is false. The else statement is executed if all preceding if
and elif conditions are false.
71. Differentiate between if-else and if-elif-if statements.
Ans: If-else statement executes one block of statement(s) when the condition is true
and the other when it is false. It is used when there are two options and only
one block of statement should be executed on the basis of a condition. If-elif-
else statement can be used to choose one block of statements from many block
of statements. It is used when there are many options and only one block of
statements should be executed on the basis of a condition.
72. Define loop structure. Write two uses of advantages of loop.
Ans: A type of control structure that executes a statement or set of statements
repeatedly is called loop structure. Loops are used to execute a statement or
number of statements for a specific number of times. Loops are used to access
a sequence of values.
73. Why loops are important in programming languages? Give three reasons.

11 | P a g e
Computer Science Class-11

Ans: Loops are important in programming languages. Firstly, they are used to repeat
a statement or set of statements repeatedly without writing the statements
again and again. Secondly, they save time and effort. Thirdly, the size of the
program is reduced using loops.
74. Describe the basic syntax of a for loop in Python.
Ans: The basic syntax of for loop in Python is as follows:
For var in (value1, value2, value3…);
statement
in the above syntax, for is the keyword that indicates the for loop. var indicates
the name of a variable used with for loop. in indicates the keyword before the
list of values. values indicates the number of times for loop will execute.
Statement indicates the statement or set of statement that will be executed by
for loop.
75. How does the range() function work in a for loop?
Ans: The range() function generates a sequence of number for the loop. It can take
one, two or three arguments as follows:
range(stop): it starts from 0 and ends at stop-1 and increment by 1.
range(start, stop): It starts from start and ends at stop-1 and increments by 1.
range(start, stop, step): It starts from start, ends at stop-1 and increment by
step.
76. Why indentation is crucial in a loop?
Ans: Indentation in Python is crucial for defining the structure of loop. It indicates
the statements that are part of the loop body. Proper indentation ensures that
the code block associated with the loop executes correctly. The wrong use of
indentation will lead to incorrect code structure and execution errors.
77. What happens if you forget to indent the code block after for loop?
Ans: A syntax error occurs if you forget to indent the code block after the loop.
Python will display an error message on the screen.
78. What is a list in Python?
Ans: A list is a type of variable in Python that can store multiple values. each item
stored in a list is called an element. Lists can store elements of different data
types including integers, floats and strings etc.

12 | P a g e
Computer Science Class-11

79. How does list differ from simple variable?


Ans: A list can store multiple values but a simple variable can store only one value.
Different types of processing can be applied on list easily. However, it is difficult
to process multiple values using simple variables.
80. How is an element is accessed in list?
Ans: Each element in the list is accessed with reference to its position of location in
the list. This position is called index. The index of first element is 0 and the index
of last element is length – 1. The value of the index is written along with the
name of list.
81. How a list is created in Python?
Ans: A list can be created by assigned values to a variable using square brackets. For
example:
my_list = [1, 2, 3, 4, 5]
An empty list can be created as follows:
empty_list = []
82. Write a Python code to create a list of even numbers from 2 to 10 and print it.
Ans: even = [2, 4, 6, 8, 10]
print(even)
83. How can you find the length of a list? Give an example.
Ans: You can find the length of a list using the len() function. For example:
my_list = [1, 2, 3, 4, 5]
print(len(my_list))
84. How can you find the smallest and largest elements in a list? Give an example.
Ans: You can find the smallest element in a list using min() function. You can find the
largest element in a list using max() function. For example:
test = [10, 20, 5, 30]
print(min(test))
print(max(test))
85. How do you add all the elements of a list? Give an example.
Ans: You can sum all the elements in a list using the sum() function. For example:
test = [1, 2, 3, 4]

13 | P a g e
Computer Science Class-11

print(sum(test))
86. How an element can be inserted into a list? Give an example.
Ans: An element can be inserted into a list using insert() method. For example:
test = [1, 2, 3]
test.insert(1, 10)
print(test) # Output: [1, 10, 2, 3]
87. What does the Index() method to do in a list?
Ans: The index() method returns the index of the first occurrence of a specified value
in the list.
For example:
test = [1, 2, 3, 2]
print(test.index(2))
88. How would you add the number 100 to the end of a list and then print the
updated list?
Ans: test = [10, 20, 30]
test.append(100)
print(test)
89. How do you check if an element exists in a list? Give an example.
Ans: You can check if an element exists in a list using the in membership operator.
For example:
test = [1, 2, 3, 4]
print(3 in test)
print(5 in test)
90. How do you know about turtle graphics
Ans: Turtle graphics is a Python that can be used to create basic graphics and
drawings. It also provides advanced features for creating animations.
Simulations and computer games. The turtle refers to a virtual drawing tool that
moves on the canvas. The canvas is like a drawing board where the turtle moves
and draws.
91. What function is used to load the canvas in Turtle Graphics?
Ans: The function used to load the canvas in Turtle Graphics is turtle.screen().

14 | P a g e
Computer Science Class-11

92. How the background color of the Turtle Graphics canvas can be changed?
Ans: The background color of Turtle Graphics canvas can be changed using
turtle.bgcolor() function:
turtle.bgcolor(“lightblue”)
93. What junction is used to change the color of the pen in Turtle Graphics?
Ans: The turtle.color() function is used to change the color of the pen in Turtle
Graphics.
94. How can you move the turtle without drawing a line?
Ans: The penup() function is used to move the pen up from the canvas so it does not
draw a line when the pen moves.
95. Write the code to draw a red circle with a radius of 50 pixels in Turtle
Graphics?
Ans: import.turtle
turtle.color(“red”)
turtle.circle(50)
96. What does the forward() function do in Turtle Graphics? Give an example.
Ans: The forward() function is used to move the turtle forward by a specified
distance towards its current direction as follows:
turtle.forward(100)
97. Which function can be used to rotate the turtle to the right by 90 degrees?
Ans: The turtle.right(90) function can be used to rotate the turtle to the right by 90
degrees.
98. Which function is used to clear the canvas in Turtle Graphics?
Ans: The turtle.reset() function is used to clear the canvas and reset the turtle to its
starting position.
99. What is a library? How is a library imported in Python program?
Ans: A library is a pre-written set of code that can be used in the programs. A library
may consist of many functions to perform different tasks. These functions can
be used by importing the required library to the program. The predefined
functions help in writing the program quickly and easily. A library can be
imported in Python program using import statement such as import datetime.

15 | P a g e
Computer Science Class-11

100. What does the strftime() function?


Ans: The strftime() function of datetime library is used to format datetime object
into a readable string. It provides different arguments to display the value of
datetime object in different formats.
101. Which argument is used in strftime() function to get the full name of the
month?
Ans: The argument ‘%B’ is used in strftime() function to get the full name of the
month.
102. Write a Python code that imports the datetime library and prints the current
date in the format “Day, Month Date, Year” (e.g “Wednesday, August 15,
2024”).
Ans: import datetime
cdate = datetime.datetime.now()
fdate = cdate.strftime(“%A, %B %d, %Y”)
print(fdate)
103. Write Python code to print the current year?
Ans: Import datetime
cdate = datetime.datetime.now()
year = cdate.strftime(“%Y”)
print(year)
104. What is the purpose of the random module in Python?
Ans: The random module in Python is used to generate random numbers in program.
It provides many functions to generate random numbers of different types.
105. What does the randint() function do in Python? Write its syntax.
Ans: The randint() function is used to generate a random number within given range.
The syntax for the randint() function is as follows:
random.randint(n1, n2)
106. Write an example to generate a random number between 5 and 15.
Ans: import random
rn = random.randint(5, 15)
print(rn)

16 | P a g e
Computer Science Class-11

107. What is a function? List any three benefits of using functions.


Ans: A function is a named block of code that performs some action. The statements
written in a function are executed when it is called by its name. functions are
the building blocks of python programs. Firstly, the functions are easier to code
and modify. Secondly, they are easier to maintain and debug. Thirdly, they can
be reused and reduces programming time.
108. What is difference between user-defined functions and built-in functions?
Ans: The user-defined functions are written by the programmer but the built-in
functions are available as part of language. The built-in functions are ready to
use but the user-defined have to be written and tested. The built-in functions
can only be used for which they are written. The user-defined function can be
written as desired.
109. Give five examples of built-in functions in Python.
Ans: Five examples of built-in functions in Python include print(), input(), int(), eval()
and len().
110. What is function call?
Ans: Function call is the statement that invokes a function. A function is executed
when it is called by its name. the function name is followed by necessary
parameters in parentheses. If there are many parameters, these are separated
by commas. The empty parentheses are used if no argument is required.
111. How does a function return value?
Ans: A function can return a single value. The keyword return is used to return the
value back to the calling function. when return statement is executed in the
function, the controls moves back to the calling function along with the
returned value. It is a good practice to write the returned value in parenthesis
“( )” after return keyword.
112. What is the difference between arguments and parameters?
Ans: The values that are passed to a function are called arguments. The variables in
the function definition that receive the values are called parameters.
113.
Ans:
114.

17 | P a g e
Computer Science Class-11

Ans:
115.
Ans:
116.
Ans:
117.
Ans:
118.
Ans:
119.
Ans:
120.
Ans:
121.
Ans:
122.
Ans:
123.
Ans:
124.
Ans:
125.
Ans:
126.
Ans:
127.
Ans:
128.

18 | P a g e
Computer Science Class-11

Ans:
129.
Ans:
130.
Ans:
131.
Ans:
132.
Ans:
133.
Ans:
134.
Ans:
135.
Ans:
136.
Ans:
137.
Ans:
138.
Ans:
139.
Ans:
140.
Ans:
141.
Ans:
142.

19 | P a g e
Computer Science Class-11

Ans:
143.
Ans:
144.
Ans:
145.
Ans:
146.
Ans:
147.
Ans:
148.
Ans:
149.
Ans:
150.
Ans:
151.
Ans:
152.
Ans:
153.
Ans:
154.
Ans:
155.
Ans:
156.

20 | P a g e
Computer Science Class-11

Ans:
157.
Ans:
158.
Ans:
159.
Ans:
160.
Ans:
161.
Ans:
162.
Ans:
163.
Ans:
164.
Ans:
165.
Ans:
166.
Ans:
167.
Ans:
168.
Ans:
169.
Ans:
170.

21 | P a g e
Computer Science Class-11

Ans:
171.
Ans:
172.
Ans:
173.
Ans:
174.
Ans:
175.
Ans:
176.
Ans:
177.
Ans:
178.
Ans:
179.
Ans:
180.
Ans:
181.
Ans:
182.
Ans:
183.
Ans:
184.

22 | P a g e
Computer Science Class-11

Ans:
185.
Ans:
186.
Ans:
187.
Ans:
188.
Ans:
189.
Ans:
190.
Ans:
191.
Ans:
192.
Ans:
193.
Ans:
194.
Ans:
195.
Ans:
196.
Ans:
197.
Ans:
198.

23 | P a g e
Computer Science Class-11

Ans:
199.
Ans:
200.
Ans:
201.
Ans:
202.
Ans:
203.
Ans:
204.
Ans:
205.
Ans:
206.
Ans:
207.
Ans:
208.
Ans:
209.
Ans:
210.
Ans:
211.
Ans:
212.

24 | P a g e
Computer Science Class-11

Ans:
213.
Ans:
214.
Ans:
215.
Ans:
216.
Ans:
217.
Ans:
218.
Ans:
219.
Ans:
220.
Ans:
221.
Ans:
222.
Ans:
223.
Ans:
224.
Ans:
225.
Ans:
226.

25 | P a g e
Computer Science Class-11

Ans:
227.
Ans:
228.
Ans:
229.
Ans:
230.
Ans:
231.
Ans:
232.
Ans:
233.
Ans:
234.
Ans:
235.
Ans:
236.
Ans:
237.
Ans:
238.
Ans:
239.
Ans:
240.

26 | P a g e
Computer Science Class-11

Ans:
241.
Ans:
242.
Ans:
243.
Ans:
244.
Ans:
245.
Ans:
246.
Ans:
247.
Ans:
248.
Ans:
249.
Ans:
250.
Ans:

27 | P a g e

You might also like