1.
Note the two Assertion and Reason statements below-
Assertion-(A): A slice of a list is an extracted part of a list
Reason-(R) A slice of a list is itself a list.
The correct option below is -Deselect Answer
2.
Note the following two assertion and reasion statements-
Assertion:- (A) The for loop is a counting loop that operates on a sequence of values
Reason :- (R) range() function creates a range of list type.
The correct option below is-Deselect Answer
3.
Observe the following sentences -
i. A list of characters is similar to a string type
ii. For any index n, s[n] + s[n:] will return the original string
iii. A dictionary can contain keys of any valid Python type
The correct pair of which is false is given below?Deselect Answer
4.
Note the following two Assertion and Reason statements
Assertion -(A): Creates a list of any comma-separated group of values.
Reason-(R): A list consists of a group of values or expressions separated by commas enclosed in [].
The correct option below isDeselect Answer
5.
Consider the loop given below -
for i in range(7, 4, -2):
break
What will be the final value of 'i' after this loop?Deselect Answer
6.
Note the two Assertion and Reason statements below-
Assertion-(A): Only while loops can use break statements.
Reason-(R): Loop while is a conditional loop in Python and terminates when its condition returns false.
The correct option below is-Deselect Answer
7.
Which of the following statements will create a repeating structure?
8.
Note the two Assertion and Reason statements below-
Assertion (A): In Python, unlike other types, the elements of a List can be changed from place to place.
Reason-(R): Lists are mutable sequences
The correct option below is –Deselect Answer
9.
Observe the following sentences-
i. A for loop can always be written as an equivalent for a while loop.
ii. The Range() function can only be used for for loops.
iii. The if-elif-else statement is equivalent to a nested if statement.
The correct pair of which is false?Deselect Answer
10.
Which is the Jump statement below?
11.
Which below is an entry – controlled loop?
12.
Which of the following functions will return the last three characters of a string s?
13.
When the following code runs, how many times is the line " x = x + 2” executed?
14.
If the user inputs 2, what will the following code print?
x = float(input())
if(x = = 1):
print("Yes")
elif (x>=2):
print("Maybe")
else
print ("No")Deselect Answer
15.
Observe the following sentences?
i. A continue statement can replace a break statement
ii. An equivalent while loop can always be written for a for loop
The correct pair of which is true?Deselect Answer
16.
What will be the output when this code is executed?
17.
Select the correct output of the following string operations.
18.
Which of the following is not a valid loop in Python?
19.
Which statement below will terminate the entire loop and proceed to the statement after the loop?
20.
Note the following two Assertion and Reason statements-
Assertion-(A): The break statement can be used with all selection and iteration statements
Reason-(R): Using break with if statement will not cause an error.
The correct option below is-Deselect Answer
21.
What is the output of the following string operation?
22.
Note the two Assertion and Reason statements below
Assertion-(A): The break statement can be used with all selection and iteration statements.
Reason-(R): Using the break with the 'if’ statement has no benefit unless the if statement is part of a looping construct.
The correct option below is-Deselect Answer
23.
Which of the following functions will return a list containing all words in a string?
24.
Observe the following sentences-
i. The partition() and split() functions work similarly.
ii. find() and index() are similar functions.
The correct pair of the true statements is-Deselect Answer
25.
What does the following Python program display?
x= 3
if x = ():
print ("Am I here?", end)
else x = 3:
` print("Or here?", end)
else:
Pass
print ("Or over here?")Deselect Answer
26.
Note the two Assertion and Reason statements below -
Assertion-(A): Lists and strings have similar indexing.
Reason-(R): Lists and strings have two-way indexing, forward indexing, and backward indexing.
The correct option below is-Deselect Answer
27.
Which of the following statements will only terminate the current pass of the loop and proceed with the next iteration of the loop?
28.
Which below will add the numbers 1 to 4?
(A) for i in range (1,4):
sum = 0
sum = sum + i
(B) Sum = 0
For i in range (1,4);
Sum = sum + i
(C) For i in range (1,5):
sum = 0
sum = sum + i
(D) Sum = 0
For i in rangle (1,5);
Sum = sum + iDeselect Answer
29.
Which of the following will print five rows with five “*” in each row?
(A) for i in range(0,5):
print("*"*i)
(B) for i in range(0,5):
print"*”*5)
(C) for i in range(1,5):
print) (“*” * i)
(D) for i in range (1,5):
print (“*” * 5)Deselect Answer
30.
Select the correct output of the following string operations.
31.
Guess the output of the following string operations-
32.
Which below is not a valid string operator?
33.
The blank may be filled in, for a in ___________
34.
Note the two Assertion and Reason statements below-
Assertion-(A): If and for are valid statements in Python.
Reason (R): If is case sensitive in Python, and its basic selection and looping statements are lowercase.
The correct option below is-Deselect Answer
35.
Which of the following string functions will replace "K' with 'z'?
36.
Consider the loop given below-
for i in range (10, 5, 3):
print(i)
How many times will this loop run?Deselect Answer
37.
Note the two Assertion and Reason statements below-
Assertion -(A):””” A Sample Python String""" is a valid Python string.
Reason-(R): Triple quotation marks are not valid in Python.
The correct option below is -Deselect Answer
38.
How many times is the code below executed?
39.
Note the two Assertion and Reason statements below-
Assertion-(A): The individual characters of a string are stored randomly in memory.
Reason-(R): Python strings are stored consecutively as individual characters in contiguous memory locations.
The correct option below is-Deselect Answer
40.
Note the two Assertion and Reason statements below-
Assertion-(A): String slices and substrings, although subparts of strings, are not the same.
Reason-(R): While the substring contains a continuous subpart of the string, the slice may or may not contain a continuous subpart of the string.
The correct option below is-Deselect Answer
41.
The correct way to create multi-line string in Python -
42.
The function range(3) is equivalent to -
43.
Observe the following sentences
i. There is no conceptual limit to list size.
ii. All elements of the list must be of the same type.
iii. A given object can appear in a list more than once.
The correct pair below of which is true is given belowDeselect Answer
44.
Which of the following statements will create a selection structure?
45.
Which below is not a valid string operator?
46.
What will be the output when the code below is executed?
Atr1 = “Mission 999”
Str2 = “999”
Print(str1,isdigit(), str2.isdigit())Deselect Answer
47.
What is meant by the end of a statement block or suit in Python?
48.
Consider the loop given below-
for i in range(3):
pass
What will be the final value of 'I’ after this loop?Deselect Answer
49.
Consider the loop given below -
What will be the final value of ‘I’ after this loop?
for i in range(10):
breakDeselect Answer
50.
Consider the loop given below-
for i in range)-5):
Print(i)
How many times will this loop run?Deselect Answer