0% found this document useful (0 votes)
9 views6 pages

Grade 11 Revision Worksheet

This document is a revision worksheet for the Indian Educational School in Kuwait for the academic year 2024-25. It contains a series of Python programming questions that cover topics such as variable declarations, data types, loops, functions, and dictionary manipulations. The worksheet aims to test students' understanding of Python concepts and their ability to write and analyze code.

Uploaded by

Tessiana
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)
9 views6 pages

Grade 11 Revision Worksheet

This document is a revision worksheet for the Indian Educational School in Kuwait for the academic year 2024-25. It contains a series of Python programming questions that cover topics such as variable declarations, data types, loops, functions, and dictionary manipulations. The worksheet aims to test students' understanding of Python concepts and their ability to write and analyze code.

Uploaded by

Tessiana
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/ 6

INDIAN EDUCATIONAL SCHOOL, KUWAIT

REVISION WORKSHEET – 2024-25


1. Differentiate between Interactive and Script mode in Python.
2. Mention any 4 features of Python.
3. Who developed Python and in which year?
4. A teacher asks a student to identify errors in the following Python variable declarations.
Find and correct the mistakes, explaining why they are incorrect.
1st_number = 10
class = "Python"
my-variable = 5
def = 20
5. Predict the output of the following Python expressions.
a) If a = 5 and b = 2
print(a / b, a // b, a ** b)
b) If a = 5.0 and b = 2
print( a ** b + a // b * b - a % b)
6. Consider the following Python statements:
x = 10
y=x+5
15 = z
(a) Identify the l-values and r-values in the given statements.
(b) There is an error in the third statement. Explain why it is incorrect and how to fix it.
7. A student is given the following Python code and is asked to classify different types of
literals used in it. Identify and categorize them correctly.
pi = 3.14
name = "Alice"
is_valid = True
num = 0x1A
8. Predict the output of the following code snippet and explain why:
x = 10
y = 3.5
z=x+y
print(type(z))

a = "25"
b=5
c = int(a) + b
print(type(c), c)

9. Consider the following Python code

x = [1, 2, 3]

y=x

y.append(4)

print(x)
a = (10, 20, 30)

b=a

b += (40,)

print(a)

(a) What will be the output of the above code?


(b) Explain why the output is different for lists and tuples.

10. Explain the term type conversion with an example.


11. Explain any two augmented and membership operators with an example.
12. Explain the use of indentation in Python programming.
13. Write a Python program that takes an integer input from the user and prints whether it is
positive, negative, or zero.
14. Write a Python program using a for loop to print the first 10 multiples of a given
number entered by the user.
15. A programmer wrote the following while loop, but it never stops.

num = 1

while num < 10:

print(num)

(a) Explain why this loop runs infinitely


(b) Modify the code to ensure it prints numbers from 1 to 10 and then stops.
(c) Suggest an optimized approach using a for loop instead of a while loop.

16. The following code is intended to print numbers from 1 to 10 but skip 5 using a while
loop. However, there is a logical mistake. Identify and correct it.

num = 1

while num <= 10:

if num == 5:

continue

print(num)

num += 1

(a) Identify the logical error in this code.


(b) Provide the corrected version of the program.
(c) Explain how break and continue work in loops.
17. Write a Python program using nested loops to print the following alphabet pattern:

AB

ABC

ABCD

ABCDE

18. Consider the following Python code and predict the output:

text = "python programming"

print(text[0:6].upper() + text[7:].capitalize())

print(text.endswith("ing"))

print(text.count('p'))

19. Write a Python program that takes a string as input and counts the number of uppercase
and lowercase letters using a loop.
20. Analyze the following Python code and predict its output:

nums = [3, 1, 4, 1, 5, 9]

nums.remove(1)

nums.pop(2)

nums.append(2)

nums.sort()

print(nums)

21. A school maintains student marks in a nested list:

students = [["Alice", 85, 90, 88], ["Bob", 78, 82, 80], ["Charlie", 92, 88, 95]]

Write a Python program to calculate and print the average marks of each student.
Also find and display the student with the highest average.

22. Consider the following tuple operations and predict the output:

tup1 = (10, 20, 30, 40, 50)

tup2 = (60, 70)

tup3 = tup1 + tup2


tup4 = tup3 * 2

print(tup4.count(30), min(tup4), max(tup4))

23. Analyze the following two scenarios and explain the difference:

list1 = [1, 2, 3]

tuple1 = (1, 2, 3)

list1.append(4)

tuple1 += (4,)

print(list1)

print(tuple1)

(a) What will be the output?


(b) Explain why append() works on list1, but a new object is created for tuple1.
(c) Compare mutability of lists vs tuples.

24. Write a Python script to create a dictionary student with following keys:

roll -integer (roll number)

name -string (name of a student)

theo -floating point (theory marks out of 70)

Edit the dictionary student by incrementing the theo by 2 marks. Display dictionary
student on the screen.

Also append two more keys:

prac -floating point (practical marks out of 30)

total -floating point (total marks theory marks + practical marks)

Input value for keys roll, name and theo. Calculate value for keys prac and total.
Display dictionary student on the screen.

25. Create a Python dictionary employee with following keys:

code -integer (employee code)

name -string (employee name)

basic -floating point (employee basic salary)


Append following keys in the dictionary employee:

da -floating point (employee dearness allowance = 75% of basic)

hra -floating point (employee house rent allowance = 55% of basic salary)

perks -floating point (employee perks 30% of basic salary)

gross -floating point (employee gross salary basic + da + hra + perks)

Input value for keys code, name and basic. Calculate value for keys hra, da, perks and
gross. Display employee dictionary on the screen.

26. Write a Python script to create dictionary employee with following keys:

code -integer (employee code)

name -string (employee name)

bsal-floating point (basic salary)

Edit the dictionary employee by adding following keys:

hra -floating point (house rent = 25% of basic salary)

da-floating point (dearness allowance = 85% of basic salary)

gsal-floating point (gross salary = basic salary + house rent + dearness allowance)

bonus-bonus and it is calculated as:

Gross Salary Bonus


<=200000 0
>200000 and <=500000 15% of Gross Salary
>500000 and <=1000000 12% of Gross Salary
>1000000 10% of Gross Salary

Input value for keys code, name and bsal. Calculate value for keys hra, da, gsal and bonus.
Display dictionary employee on the screen.

27. Which of the following statements, when executed by the


interpreter, will give an error and which one will execute successfully?
Provide a reason for your answer.
a) Remark=“V HOOD”
Remark[2]=“G”
b) Marks=[23,45,67,34,78]
Marks[2]=95
28. (a) Arrange the following operators <, or, and, ** from higher
precedence to lower precedence.
(c) If num=3945, write a python statement to display the digit at
hundreds place.
29. Consider the list gr1=["A","B","A","C","B","D"], write a statement in
python :
a) To display the position of the first occurrence of the character ‘B’ in the
list gr1.
b) To remove the fourth element from the list gr1.
30. Consider the list city=["mys","bgr","hub","has","bgm"], write a
statement in python:
a. To remove the last element.
b. To insert new city ‘mnd’ between ‘mys and ‘bgr’.
31. Go through the following python program. Identify the possible
output(s) from the following.

import random

x=[25,55,62,22,99,74]

y=len(x)-2

for i in range(2,y):

n=random.randint(i,5)

print(x[n-1],x[n],end=" ")

a. 99 74 22 99
b. 55 62 62 22
c. 99 25 55 25
d. 74 74 25 99

You might also like