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

Python Fundamentals WS 1

Uploaded by

harish.m
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Python Fundamentals WS 1

Uploaded by

harish.m
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Class: XII Worksheet No: 1

Subject: (083) Computer Science

1. Choose odd one out:-


A. except
B. with
C. import
D. else
2. What will be the output of the following code segment?
L=[‘A’,’a’,’Aa’,’aA’]
Print(max[l])
A. ‘aA’
B. ‘A’
C. ‘a’
D. ‘Aa’
3. Which one of the followings is logical operator:
A. Exponent
B. Modulus
C. And
D. Floor division
4. What is the length of the given tuple?
t1= (1,2,(3,4,5))
5. Which is not a string out of the followings:-
A. ‘55’
B. “X.Y”
C. “ Hello 1”
D. None of the above
6. Name the module which will be needed to use the function max( ):-
A. Math
B. Random
C. Stat
D. No module required
7. Which command we can use to remove string “hello” from list1, Given, list1=[“hello”]
A. list1.remove(“hello”)
B. list1.pop(list1.index(“hello”))
C. Both a & b
D. None of these

8. Which of the following is not a function of tuple?


A. update( )
B. index( )
C. len( )
D. count( )

9. Write the output of the following: a= (1, 2, 3, 2, 3, 4, 5) print(min(a) + max(a) +


a.count(2))

10. Write the output of the following. A = tuple(“Python”) print(A)

A. (python)
B. (“Python”)
C. (‘P’ , ‘y’ , ‘t’ , ‘h’ , ‘o’ , ‘n’)
D. None of the above

11. Which command we use cane use To remove string “hello” from list1, Given,
list1=[“hello”]

A. list1.remove(“hello”)
B. list1.pop(list1.index('hello'))
C. both a & b
D. none of these

12. Which of the following is not a declaration of the dictionary?

A. {1: ‘A’, 2: ‘B’}


B. dict([[1,”A”],[2,”B”]])
C. {1,”A”,2”B”}
D. { }

13. Write the output of-


d={0:'zero',1:'one',2:'two',3:'three'}
for i in d:
print(i, end=' ')

14. Which statement does not show any error after execution? Given L=[1,2,3,4]
A. print(L+L)
B. print(L*L)
C. print(L-L)
D. All of the mentioned

15. Evaluate the expression given below if A = 16 and B = 15.


A%B / / A

16. What will be the possible output of the following code?

import random List=[’Delhi’,’Mumbai’,’Chennai’,’Kolkata’]


for y in range(4):
x=random.randint(1,3)
print(List[x],end=’#’)

A. Delhi#Mumbai#Chennai#Kolkata#
B. Mumbai#Chennai#Kolkata#Mumbai#
C. Mumbai# Mumbai #Mumbai # Delhi#
D. Mumbai# Mumbai #Chennai # Mumbai

17. Which of the following statement will return an error? T1 is a tuple.

A. T1 + (23)
B. T1 + [3]
C. Both of the above
D. None of the above

18. Which of the following declarations is incorrect?


A. _x = 2
B. x=3
C. xyz =5
D. None of these

19. Which of the following is correctly evaluated for this function?

pow(x,y,z)

A. (x**y) / z
B. (x / y) * z
C. (x**y) % z
D. (x / y) / z

20. Which of the following is not used as loop in Python?

A. for loop
B. while loop
C. do-while loop
D. None of the above.

You might also like