0% found this document useful (0 votes)
36 views5 pages

IP Revision Worksheet - UT2

Uploaded by

Shreyas Murali
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)
36 views5 pages

IP Revision Worksheet - UT2

Uploaded by

Shreyas Murali
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/ 5

Informatics Practices - Grade XI

REVISION WORKSHEET
2024-25
Name:__________________ Grade:_______
____________________________________________________________

1. Consider the following code :


N=int(input(“Enter N:”))
i=1
sum=0
For i in range(1,N):
if(i%2==0):
sum=sum+1
i=i+1
print(sum)
a. What is the output when N is 2?
b. What is the output when N is 5?
2. Write a program to print the multiplication table of a number entered by the user.
3. What do you mean by traversing a list? Write a program to traverse a list.
4. Write the corresponding Python assignment statements:
a) Assign 10 to variable length and 20 to variable breadth.
b) Assign the average of values of variables length and breadth to a variable sum.
c) Assign a list containing strings ‘Paper’, ‘Gel Pen’, and ‘Eraser’ to a variable stationery.
d) Assign the strings ‘Mohandas’, ‘Karamchand’, and ‘Gandhi’ to variables first, middle
and last.
e) Assign the concatenated value of string variables first, middle and last to variable
fullname. Make sure to incorporate blank spaces appropriately between different parts of
names.
5. Write a program to accept a character from the user and display whether it is a vowel or not.
6. Write a program to enter the percentage of a student and print his grade based on the
following:

Percentage>85 → Grade A

70<Percentage<=85→ Grade B

60<Percentage<=70 → Grade C

45<Percentage<=60 → Grade D

Percentage<=45 → Grade E

7. Write the syntax and definition of the following functions in the list.
a. insert()
b. append()
c. extend()
d. reverse()
e. index()

8. Find the output of the following program segments:


a) for i in range(20,30,2):
print(i)
20
22
24
26
28
b) country = 'INDIA'
for i in country:
print (i)
I
N
D
I
A

9. What will be the output produced by following code:


a. name=’neeru’
age=21
print(name, ”you are”,21,”now but”)
print(“you will be ”,age+1,”next year”)
b. x,y=2,6
x,y=y,x+2
print(x,y)

c. p=10
q=20
p*=q/2
q+=q/3
print(p,q)

10. Write any two features of python.


11. Identify invalid variable names from the following, giving reason for each:
if , s.i , tot_strength , 9tag.
12. Write a program to count the frequency of an element in a given list.
13. Write a program to print the following pattern:
**
**
**
14. Predict the output-
x=100
x=x+100
x=x-5
print(x)
x,y=x-5,190
print(x,y)
15. Write a program in python to find the largest among three inputted numbers.
16. Predict the output:
for k in range(13,3,-2):
print(k* 2)
17. Consider the following list
List1=[2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]
Write commands for the following:
i. Add 20 at last
ii. Insert 4 at third position
iii. Sort the elements of the list
iv. Count how many times 6 is available
v. Delete all elements from 3rd to 9th position
vi. Delete 11 from the list
vii. Search the position of 13 in the list
viii. Find the maximum value of the list
ix. Find the length of the list
x. Delete all the elements of the list
18. Write the outputs :-
Nlist = ['p','r','o','b','l','e','m']
print(Nlist.remove('p'))
print(Nlist.pop(3))
print(Nlist.pop())
print(Nlist[-2])
print(Nlist.index(‘e’))
Nlist.clear()
print(Nlist)
19. Write the program to find the product of all the even natural numbers upto N where N is a
positive integer.
20.What is the purpose of following operators :
**, // , in, not in

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

You might also like