0% found this document useful (0 votes)
89 views4 pages

XI - Chapter 5 - WSheet - Getting Started With Pythnon - Compressed

This document is a worksheet for Class XI Computer Science covering Python programming concepts. It includes multiple-choice questions on topics such as comments, variable declaration, operators, data types, and error types in Python. The worksheet aims to assess students' understanding of fundamental Python programming principles.

Uploaded by

littlechef482
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)
89 views4 pages

XI - Chapter 5 - WSheet - Getting Started With Pythnon - Compressed

This document is a worksheet for Class XI Computer Science covering Python programming concepts. It includes multiple-choice questions on topics such as comments, variable declaration, operators, data types, and error types in Python. The worksheet aims to assess students' understanding of fundamental Python programming principles.

Uploaded by

littlechef482
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
You are on page 1/ 4

CLASS XI – COMPUTER SCIENCE (2025-26)

UNIT 2 – COMPUTATIONAL THINKING AND PROGRAMMING-I


CH-5 GETTING STARTED WITH PYTHON
WORKSHEET

Q.1 Which of the following is used to indicate a comment in Python?


a) // b) # c) /* */ d) <!-- -->

Q.2 Which of the following is the correct way to declare a variable in Python?
a) int x = 10 b) x = 10 c) declare x = 10 d) var x = 10

Q.3 Which of the following operators will return either True or False?
a) + b) != c) = d) *=

Q.4 Which of the following is an invalid variable?


a) Subject_10 b) Subject10_ c ) _Subject10 d ) 10_Subject

Q.5 What will be the output of the following ?


a) 87//5 b) (87//5.0) == (87//5) c) 87//5.0 d) 17%5.0

Q.6 Identify the valid relational operator(s) in Python from the following:
a) = b) < c) <> d) not

Q.7 Which function out of the following will return the data type of the object:
a) type() b) id() c) ord() d) str()

Q.8 a=input ("Enter a number").


The datatype of the variable a will be ___________
a) float b) int c) bool d) string

Q.9 p = 60
q = int(input("Sec No = "))
print (p/q)
If the user inputs a 0 for q, the above code will leads to___________

a) Semantic Error b) Syntax Error c) Runtime Error d) No Error

Q.10 The input() returns the value as _______________ type


a) int b) string c) float d) list

Q.11 A _________ is a bug in the program that causes it to behave incorrectly.


a) Logical error b) Syntax error c) Runtime error d) Zero error
Q.12 Consider the following in python and choose the correct option of output 1.
>>>a=[1,2,3,4]
>>>1 not in a
a) False b) a is not defined c) True d) error in code

Q.13 Which is not a valid operator?


a) += b) and c ) =! d ) ==

Q.14 What will be the output of the following?


a) bool(0) b) bool(“0”) c) bool(int(“0”)) d) bool(str(0.0)) (e) bool(0j) (f) bool(0.0)

Q.15 Identify each of the following whether mutable and immutable :


i. X= “Great India”
ii. Y= { 1: “Monday”, 3: “Wednesday”, 5: “Friday”, 7: “Sunday” }
iii. Z= [“a”,”e”, “i”, “o”, “u”]
iv. W= (“Rakesh”, “Rajesh”, “Ravindra”, “Pawan”, “Santosh”)

Q.16 What will be the output of following code:


A= 3 + int (5/2)
B= A/2
print( A, B)
Q.17 What will be the output of following code:
A=True
B= 0<5
print(A= =B)
print(A is B)
Q.18 What will be the output of following code :
a, b = 10, 2
a, b, a= a +5, b+2, a+4
print(a, b)

Q.20 What will be value of x after evaluation of each of following separately:


i. x = 29 / 5
ii. x = 39 // 4 * 2
iii. x = 3 ** 2 ** 2
iv. x = 2 ** 5 % 3 -5

Q.21 Evaluate the following logical expressions:


i) 5+2**6<9+2-16//8
ii) 3 and 5<15 or 3<13 and not 12<2
iii) (10 <4) and (5<5) or (3< 20) and not 77<78
iv) (6*5) //3/2*10+20-4
Q.22 Write the python expression for the following:
(a+b)2 = a2+2ab+b2

Q.23 What will be the final output of following logical expression :


(17 >4) or (3<5 ) and not (3< 2) and not 17 < 18

Q.24 What will be the type of final evaluated value of following expressions:
i. print (type (5*2))
ii. print (type (3 * 32 // 16))
iii. print (type (14 * 5.0 *2))
iv. print (type (50/2 + 5))

Q.25 Identify the data type of the following:


i. X= “Great India”
ii. Y= { 1: “Monday”, 3: “Wednesday”, 5: “Friday”, 7: “Sunday” }
iii. Z= (“a”,”e”, “i”, “o”, “u”)
iv. W= [“Rakesh”, “Rajesh”, “Ravindra”, “Pawan”, “Santosh”]

Q.26 What will be the output of the following?

Q.27 State output produced by the following code statements?


(i) 87//5
(ii) 87//5.0

Q.28 Evaluate the following expressions:


a) 15*(4%4)//2+6
b) not 10> 5 and 2 < 11 or not 10 < 2
c) print(15.0 /4+(8+ 3.0)
d) print (4+3*5/3-5%2)

Q.29 What will be the output of the following?


(a)12/4 (b)14//14 (c)14%4 (d) 14.0/4 (e) 14.0//4 (f)14.0%4

Q.30 Predict the output of the following:


x, y=2,3
x, y, x = x+4, y+2, x+12
x = x+y
y*=x
print(x, y)
Q.31 Evaluate the following expressions:
a) 7+9//2**3*2-(4+1)
b) 5<10 and 12>7 or not 7>4

Q.32 Identify the data types of the following values given bellow –
3, 3j, 13.0, ‘12’, “14”, 2+0j, 19, [1,2,3], (3,4,5)

Q.33 Find the output.


p, q, r=1,3,5
p, q, p=p*q, p*r, q*r
print(p, q, r)

Q.34 Classify the following as syntax error logical error or runtime error, state reasons.
num1, num2 =25,0
print(num1/num2)

Q.35 Mark the correct choice for the following assertion and reasoning.
(a)Both A and R are true and R is the correct explanation for A
(b)Both A and R are true and R is not the correct explanation for A
(c)A is True but R is False
(d)A is false but R is True

1. Assertion(A): Lists and Tuples are similar sequence types of Python, yet they are two different data
types.
Reasoning(R): List sequences are mutable and Tuple sequences are immutable.

2. Assertion(A): List is an immutable data type.


Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable
is destroyed and a new variable is created by the same name in memory.
3. Assertion (A): In Python, strings, lists and tuples are called Sequences.
Reasoning (R): Sequence is referred to as an ordered collection of values having similar or different
data types.
4. Assertion (A): Python supports multiple execution modes
Reasoning (R): Interactive mode allows the user to enter and execute one statement at a time, while script
mode allows the user to run a file containing multiple statements.

5. Assertion (A): Python is a dynamically typed language.


Reasoning (R): In Python, variables are not explicitly declared with a data type.

6. Assertion (A): Python supports multi-line comments using the # symbol.


Reasoning (R): Python uses triple quotes (''' or """) for multi-line comments.

7. Assertion (A): In Python, an identifier can start with a number.


Reasoning (R): In Python, identifiers must start with a letter or an underscore.

8. Assertion (A): In Python, variables are explicitly typed when declared.


Reasoning (R): Python is a dynamically typed language, so the type of a variable is determined at
runtime based on the assigned value.

************************

You might also like