Final 11th Important Questions
Final 11th Important Questions
Final 11th Important Questions
(a) integers
(b) floats
(c) lists
(d) tuples
(a) [1, 2] * 2
(b) [1, 2, 2]
(c) [1, 1, 2, 2]
(d) [1, 2, 1, 2)
(d) In Python, a tuple can contain either string or integer but not both at a time.
8.Which of the following function will return the key, value pairs of a dictionary?
9. The order of statement execution in the form of top to bottom is known as _________
Construct
l = [‘None’]*10
print(len(l))
11. What is the name of programs that control the computer system?
(a) print(len (d1)) (b) print(d1.get(“b”)) (c) d1 [“a”] = 5 (d) None of these
tp = ( )
tp1 = tp * 2
print(len(tp1))
for i in range(2,4):
print(i)
19. Which of the following are not valid symbols in hexadecimal number system?
21. Which of the following functions removes all leading and trailing spaces from a string?
(b) Both A and R are True and R is not the correct explanation for A.
22) Assertion (A): The information which was posted by you in online can be seen by
Reason (R): Don’t give or post any personal information like your name, address of the
23) Assertion (A): The digital footprint is created automatically when you work on
Reason (R): The active digital footprint is created unintentionally without the user’s
consents.
Python supports two types of strings — Single-line strings and Multi-line strings. Single line
strings are enclosed in single or double quotes and terminate in one line. Multi-line strings store
multiple lines of text and are enclosed in triple quotes.
if(4+5 == 10):
print(“TRUE”)
else:
print(“FALSE”)
print(“TRUE”)
o/p:
FALSE
TRUE
print(min(tp1))
print(sum(val))
print(t1)
o/p:
(i)Ana
(ii)126
(iii)(1,2)
n=6
if n == 5:
print(“Welcome Python”)
else:
print(“Is it correct?”)
print(“Not sure”)
o/p:
Is it correct
Not sure
5.for p in range(8):
print(p, end = ‘ ’)
O/p: No Output.
6. Jump Statement: As the name suggests, a jump statement is used to break the normal flow of
the program and jump onto a specific line of code in the program if the specific condition is true.
In simple words, it transfers the execution control of the program to another statement if a
specific condition associated becomes true.
7. string=input(“Enter a string:”)
count=3
while True:
if string[0]== ‘a’:
string=string[2:]
string=string[:2]
else:
count+=1
break
print(string)
print(count)
(i) aabbcc
o/p: bbcc
4
(ii) aaccbb
o/p cc
4
L1.sort()
print(L1)
o/p:
C=L1.count(5)
print(C)
o/p:
L1.remove(‘o’)
L1.insert(1, ‘p’)
print(L1)
o/p:
T1 = (1, 2, 3, 4, 5, 6, 7)
o/p:
(2, 3, 4, 5, 6, 2, 3, 4, 5, 6)
print(old)
print(new)
o/p:
(i)x = 40
y=x+1
x = 20, y + x
print(x, y)
o/p:
(20, 81) 41
(ii) x, y = 20, 60
y, x, y = x, y- 10, x+10
print(x, y)
o/p:
50 30
(iii) a, b = 12, 13
c, b = a * 2, a/2
print(a, b, c)
o/p:
12 6.0 24
(iv) a, b = 12, 13
print(print(a +b))
o/p:
25
None
(v) a, b, c = 2, 3, 4
a, b, c = a * a, a * b, b * c
print(a, b, c)
o/p:
4 6 12
What would be displayed in python shell for each of the following expression?
(v) >>>letters
O/p: NO Output.
14. Sita has written a code in python, but she is not able to get the desired output. Help Sita to
CODE:
print(x.rightStrip()) # line 2
for i in x:
if (x.CapitalLetter()): # line 3
print(i)
print(y[5:1:-1]) # line 4
(i) Sita is not getting the concatenated string in line 1, what should she change:
a. x.rightstrip() b. x.rStrip()
c. x.rstrip() d. x.RStrip()
a. x.capitalletter() b. x.caps()
c. x.upper() d. No error.
15. In python, the random ( ) functions is used to return a number randomly between the
range of two numbers. It’s a variable in the random module of the python. Based on the
above discussion, pick from the given options, the probable return value when the code
executes.
(i) random. randint (1, 15) function is used: