Please refer to Python Fundamentals Class 11 Computer Science Exam Questions provided below. These questions and answers for Class 11 Computer Science have been designed based on the past trend of questions and important topics in your class 11 Computer Science books. You should go through all Class 11 Computer Science Important Questions provided by our teachers which will help you to get more marks in upcoming exams.
Class 11 Computer Science Exam Questions Python Fundamentals
Class 11 Computer Science students should read and understand the important questions and answers provided below for Python Fundamentals which will help them to understand all important and difficult topics.
Question. Which of the following is false about “import modulename” form of import?
(a) The namespace of imported module becomes part of importing module
(b) This form of import prevents name clash
(c) The namespace of imported module becomes available to importing module
(d) The identifiers in module are accessed as: modulename.identifier
Question. Ankita has used some predefined functions in her program like sin() and randint(). But when she executes the program , it display error(s) that she hadn’t included required module. Help her to find which Python Library module she needs to import?
(a) math and trig module
(b) random and string module
(c) math and random module
(d) random module only
Question. What is the value returned by math.fact(6)?
(c) [1, 2, 3, 6].
Question. Which of the following aren’t defined in the math module?
(d) none of the mentioned
Question. All modular designs are because of a top-down design process? True or False?
Question. Which of the following random module function generates a floating point number?
(d) all of the above
Question. Which of the following is false about “from-import” form of import?
(a) The syntax is: from modulename import identifier
(b) This form of import prevents name clash
(c) The namespace of imported module becomes part of importing module
(d) The identifiers in module are accessed directly as: identifier
Question. Which is the correct command to load just the tempc method from a module called usable?
(a) import usable, tempc
(b) import tempc from usable
(c) from usable import tempc
(d) import tempc
Question. The help <module> statement displays____ from a module
Question. A Python module has ______ extension
Question. What is the output of the following piece of code?
from math import factorial
(b) Nothing is printed
(c) Error, method factorial doesn’t exist in math module
(d) Error, the statement should be: print(factorial(5))
Question What is the output of the function shown below if the random module has already been imported?
(b) Any integer between 3.5 and 7, including 7
(c) Any integer between 3.5 and 7, excluding 7
(d) The integer closest to the mean of 3.5 and 7
Question. Which of these definitions correctly describes a module?
(a) Denoted by triple quotes for providing the specification of certain program elements
(b) Design and implementation of specific functionality to be incorporated into a program
(c) Defines the specification of how it is to be used
(d) Any program that reuses cod
Question. Which of the following is not a valid namespace?
(a) Global namespace
(b) Public namespace
(c) Built-in namespace
(d) Local namespace
Question. What is returned by math.ceil(3.4)?
Question. To include the use of functions which are present in the random library, we must use the option:
(a) import random
Question. Which file must be a part of a folder to be used as a Python package?
Question. What is the value returned by math.floor(3.4)?
Very Short answer Type Questions
Question: What is the error in following code: x, y =7 ?
Answer: The following error comes – ‘int’ object is not iterable. Which means an integer object i.e.
cannot be repeated for x and y. one more integer object is required after 7.
Question: What is None literal in Python?
Answer: Python has one special literal, which is None. The None literal is used to indicate absence of
value. It is also used to indicate the end of lists in Python. It means ―There is nothing here‖.
Question: Following code is creating problem X = 0281, find reason.
Answer: 0281 is an invalid token.
Question: Find the error in the following code:
(a) y = x +5 (b) a=input(“Value: “) (c) print(x = y = 5)
print(x,y) b = a/2
print( a, b)
Answer: (a) Name ‘x’ is not defined.
(b) Unsupported operand type(s) for /: ‘str’ and ‘int’.
(c) Invalid Syntax.
Question: what will the following code do: a=b=18 ?
Answer: This code will assign 18 to a and b both.
Question: Find the error in the following code: 5
b = a + b
print( a And b)
(d) a, b, c=2, 8, 4
print(a, b, c)
c, b, a = a, b, c
print(a; b; c)
(e) x = 23
4 = x
(f) else = 21-4
Answer: (a) Missing parentheses in call to ‘print’.
(b) Name ‗b‘ is not defined.
(c) Invalid Syntax.
(d) Invalid Syntax in second print statement.
(e) can’t assign to literal in second line.
(f) Invalid Syntax.
Short Answer Type Questions
Question: What is the difference between a keyword and an identifier?
Answer: Difference between Keyword and Identifier: Every language has keywords and identifiers,
which are only understood by its compiler. Keywords are predefined reserved words, which
possess special meaning. An identifier is a unique name given to a particular variable, function
or label of class in the program.
Question: What are tokens in Python? How many types of tokens allowed in Python?
Answer: Tokens are the smallest unit of the program. There are following tokens in Python:
- Reserved words or Keywords
- Literals Definition of all tokens may come. Which is not given
- Operators in this question bank.
Question: What are literals in Python? How many types of Literals allowed in Python?
Answer: Literals: Python comes with some built-in objects. Some are used so often that Python has a
quick way to make these objects, called literals.
The literals include the string, Unicode string, integer, float, long, list, tuple and
Question: How many types of sequences are supported in Python?
Answer: Three Types of Sequences are supported in python:
Question: What is the difference between an expression and a statement in Python?
Answer: A statement is an instruction that the Python interpreter can execute. We have only seen the
assignment statement so far. Some other kinds of statements that we‘ll see shortly
are while statements, forstatements, if statements, and import statements. (There are other
An expression is a combination of values, variables, operators, and calls to functions.
Expressions need to be evaluated. If you ask Python to print an expression, the
interpreter evaluates the expression and displays the result.
Question: What are operators? What is their function? Give examples of some unary and binary operators.
Answer: “Operators are those symbols used with operands, which tells compiler which operation is to be
done on operands.‖ in other words – ―operators are tokens that trigger some
computation/action when applied to variables and other objects in an expression.‖
Operators are of following types:
- Unary operators like (+) Unary Plus, (-) Unary Minus, not etc.
- Binary Operators like (+) addition, (*) multiplication, and etc.
Question: What factors guide the choice of identifiers in program?
Answer: (i) An identifier must start with a letter or underscore followed by any number of digits
(ii) No reserved word or standard identifier should be used.
(iii) No special character (Other than underscore) should be included in the identifier.
Question: How many types of strings are supported by Python?
Answer: Python supports two types of strings:
(i) Single-line string That terminates in single line.
(ii) Multi-line String That stores multiple lines of text.
Question: What is block/code block/suit in Python?
Answer: Sometimes a group of statements is part of another statement of function. Such a group of one
Question: What is the role of indentation in Python?
Answer: Indentation plays a very important role in Python. Python uses indentation to create blocks ofcode. Statements at same indentation level are part of same block/suit. Youcannot
unnecessarily indent a statement; python will raise an error for that.
Skill Based Questions
Question: How can you create multi-line strings in Python?
Answer: We can create multi-line string by putting a backslash (\) at the end of line which allows you tocontinue typing in next line in same string.
Question: What will be the output of the following code:
Answer: Output: Hari , you are 18 now but You will be 19 next year
Question: Which of the following are syntactically correct strings? State reason.
(a) ”Python is nice Language”
(b) „He called me “Friend!” when he came‟
(c) “Very Good‟
(d) „This is a good book‟
(f) “I liked „Harry Potter‟ very much”
Answer: (a) Correct (b) Correct (c) Incorrect (d) Correct (e) Incorrect (f) Correct
Question: What is the error in following Python program with one statement?
print(“My name is : “, name) suggest a solution 4
Answer: Error is : ―name ‘name’ is not defined‖. And the solution is to declare the variable-name before
Question: What will be the sizes of following constants? 1
(a) „\a‟ (b) “\a” (c) “Kumar\‟s” (d) „\”‟ (e) “it‟s”
Answer: (a) 50 (b) 50 (c) 56 (d) 50 (e) 53
This screenshot is the output of the above question.
Question: Write a Program to obtain temperature in Celsius and convert it into Fahrenheit using formula –7
C X 9/5 + 32 = F
Question: WAP to calculate simple interest.
Question: WAP to read todays date (only date Part) from user. Then display how many days are left in the current month.
Question: WAP to print the area of circle when radius of the circle is given by user.
Question: Predict the output of the following:
Answer: Output: 17 5
Question: Predict output:
Answer: Output: 4 6 8
Question: WAP that asks your height in centimeters and converts it into foot and inches.
Question: WAP to find area of a triangle.
Question: WAP to print the volume of a cylinder when radius and height of the cylinder is given by user.
Question: WAP to read a number in n and prints n2, n3, n4
Case Based Questions :
Read the following incomplete code snippet and answer the questions following it.
import …….. #Line1
Pick= ….. . randint(0,3) #Line2
for I in city:
for j in …..(1,Pick): #Line3
Question. Which function will be used in Line3?
Question. Identify the suitable code for blank space marked in Line1
(c) math, random
(d) None of the above
Question. Choose the keyword to be used in the given space of Line2
(b) math, random
(c) date and time
Read the following code snippet carefully and answer the questions following it-:
a= int(math.pow(3,2)) #Line1
x = math.isfinite(float(‘0.0’)) #Line3
Question. What will x return in Line3?
Question. What will get stored in variable a of Line1?
Question. What is the alternate way of writing exp() in Line2?
(a) (math.e ** p) – 1
(b) math.e ** (p – 1)
(d) none of the mentioned
We hope you liked the above provided Python Fundamentals Class 11 Computer Science Exam Questions. If you have any further questions please put them in the comments section below so that our teachers can provide you an answer.