Teachers and Examiners (CBSESkillEduction) collaborated to create the String in Python Class 11 MCQ. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.
String in Python Class 11 MCQ
1. _________ is a sequence which is made up of one or more UNICODE characters.
a. String
b. Number
c. Float
d. Double
2. String can be a _________.
a. Letter
b. Digit
c. Whitespace & Symbol
d. All of the above
3. A string can be assign by enclosing ______ quote.
a. Single
b. Double
c. Triple
d. All of the above
4. Each individual character in a string can be accessed using a technique called _______.
a. Indexing
b. Method
c. Storing
d. None of the above
String in Python Class 11 MCQ
5. The index specifies the character to be accessed in the string and is written in square brackets _______.
a. ( )
b. [ ]
c. { }
d. None of the above
6. In the string, the index of the first character start from ______.
a. 0
b. n-1
c. 1
d. None of the above
7. In the string, the index of the last character ______.
a. 0
b. n-1
c. 1
d. None of the above
8. If we give index value out of this range then we get an _______.
a. Run time Error
b. IndexError
c. Syntax Error
d. None of the above
9. What will be the output of the following python code
str1=”Welcome to my \n School”
print(str1)
a. Welcome to my
b. Welcome to my School
c. Welcome to my
School
d. None of the above
String in Python Class 11 MCQ
10. What will be the output of the following python code
str1=”Welcome to \
my School”
print(str1)
a. Welcome to my School
b. Welcome to
my School
c. Welcome to \ my School
d. None of the above
11. A string is an _______ data type.
a. Mutable
b. Immutable t
c. Both a) and b)
d. None of the above
12. Immutable data type means _________.
a. String can be changed after it has been created
b. String cannot be changed after it has been created
c. Both a) and b)
d. None of the above
13. Concatenate means ______.
a. to Join
b. to Divide
c. to Split
d. None of the above
14. Python allows us to join two strings using concatenation operator _______.
a. + +
b. + –
c. +
d. None of the above
String in Python Class 11 MCQ
15. Python allows us to repeat the given string using repetition operator which is denoted by symbol _________.
a. *
b. &
c. #
d. $
16. It is possible to retrieve each individual character in a string using a method _________ .
a. Concatenation
b. Indexing
c. Replication
d. All of the above
17. We receive a ________ if we provide an index value that is outside of the range.
a. Syntax Error
b. Run time Error
c. Index Error
d. None of the above
18. Python has two membership operators _______ and ______.
a. In and Out
b. In and Not
c. True and False
d. None of the above
19. The _________ operator also takes two strings and returns True if the first string does not appear as a substring in the second string, otherwise returns False.
a. Not
b. Not to
c. Not in
d. Not out
String in Python Class 11 MCQ
20. In Python, to access some part of a string or substring, we use a method called _______.
a. Joining
b. Slicing
c. Accessing
d. None of the above
21. The string’s initial character is at index 0 from ________.
a. Right side
b. Left side
c. Both a) and b)
d. None of the above
22. If a string’s contents cannot be modified, the string is __________.
a. Immutable
b. Mutable
c. Both a) and b)
d. None of the above
23. String data types can perform _______ operations in Python.
a. Slicing
b. Concatenation
c. Membership
d. All of the above
24. We can access each character of a string or traverse a string using ______ and ________.
a. If and for loop
b. for and while loop
c. for and do-while loop
d. None of the above
String in Python Class 11 MCQ
25. ________ returns the length of the given string.
a. title()
b. len()
c. length()
d. None of the above
26. _______ returns a list of words delimited by the specified substring. If no delimiter is given then words are separated by space.
a. partition ()
b. split()
c. divide()
d. None of the above
27. Following is an example of _________.
str1 = “cbseskilleducation.com”
a. String
b. Dictionary
c. List
d. None of the above
28. What will be the output of the following code.
str1=”Welcome”
str1=”Welcome to my School”
print(str1)
a. Welcome
b. Welcome to my School
c. Welcome Welcome to my School
d. None of the above
29. _______returns the string with first letter of every word in the string in uppercase and rest in lowercase.
a. upper()
b. lower()
c. title()
d. None of the above
String in Python Class 11 MCQ
30. ________ returns the string with all uppercase letters converted to lowercase.
a. lower()
b. upper()
c. title()
d. None of the above
31. ________returns the string with all lowercase letters converted to uppercase.
a. lower()
b. upper()
c. title()
d. None of the above
32. Same as find() but raises an exception if the substring is not present in the given string.
a. find(str, start, end)
b. index(str, start, end)
c. endswith()
d. None of the above
33. _______ returns True if the given string ends with the supplied substring otherwise returns False.
a. find(str, start, end)
b. index(str, start, end)
c. endswith()
d. None of the above
34. What will be the output of the following python code
str1=”WelcometomySchool”
print(len(str1))
a. 17
b. 18
c. 19
d. 20
String in Python Class 11 MCQ
35. What will be the output of the following python code
str1=”’Welcome
to
my
School”’
print(str1)
a. Welcome to my School
b. Welcome
to
my
School
c. Welcome to
my School
d. None of the above
to
my
School
36. ________ returns True if characters of the given string are either alphabets or numeric. If whitespace or special symbols are part of the given string or the string is empty it returns False.
a. isalnum()
b. islower()
c. isupper()
d. None of the above
37. What will be the output of the following python code
str1=”Welcome to my School”
print(len(str1))
a. 17
b. 18
c. 19
d. 20
38. _______ returns True if the string is non-empty and has all lowercase alphabets, or has at least one
character as lowercase alphabet and rest are non-alphabet characters.
a. isalnum()
b. islower()
c. isupper()
d. None of the above
39. ________ returns True if the string is non-empty and all characters are white spaces (blank, tab,
newline, carriage return).
a. isspace()
b. istitle()
c. istrip()
d. rstrip()
String in Python Class 11 MCQ
40. ________ returns the string after removing the spaces both on the left and the right of the string.
a. isspace()
b. strip()
c. istrip()
d. rstrip()
41. ________ returns the string after removing the spaces only on the left of the string.
a. isspace()
b. istitle()
c. istrip()
d. rstrip()
42. ________ returns the string after removing the spaces only on the right of the string.
a. isspace()
b. istitle()
c. istrip()
d. rstrip()
43. What will be the index value of ‘h’ in the following python code
str1=”Python”
a. 3
b. 4
c. 5
d. 6
44. What will be the output of the following python code
str1=”Python”
str1[0]=”M”
print(str1)
a. Python
b. Mython
c. Pythonm
d. None of the above
String in Python Class 11 MCQ
45. What will be the output of the following python code
str1=”Python”
print(str[5])
a. Index Error
b. Run time Error
c. Output Error
d. None of the above
46. What will be the output of the following python code
print(“Python”.replace(“Python”,”My Python”))
a. Python My Python
b. Python
c. My Python
d. None of the above
47. What will be the output of the following python code
for i in “Python”:
print(i)
a. Python
b. Py
th
on
c. P
y
t
h
o
n
d. None of the above
y
t
h
o
n
48. Which operator can be applied to both integer and string values?
a. *
b. /
c. %
d. –
49. What will be the output of the following python code
str1 = 20 + “20”
print(str1)
a. Syntax Error
b. TypeError
c. No Error
d. None of the above
String in Python Class 11 MCQ
50. Which operator is used to concatenate strings?
a. ++
b. +
c. –
d. /
51. What will be the output of the following python code
print(len(“\\\@\\\/@”))
a. 6
b. 7
c. 8
d. 9
52. What will be the output of the following python code
for i in (1,2,3,4):
print(“*” * i)
a.
*
**
***
****
b.
*
****
c.
****
***
**
*
d. None of the above
*
**
***
****
53. What will be the output of the following python code
print(“Python”[2:3])
a. Error
b. h
c. t
d. No Output
54. What will be the output of the following python code
print(“P-y-t-h-o-n”.split(“-“,3))
a. [‘P’, ‘y’, ‘t’, ‘h-o-n’]
b. [‘P’, ‘y’, ‘t-h-o-n’]
c. [‘P’, ‘y-t-h-o-n’]
d. None of the above
String in Python Class 11 MCQ
55. What will be the output of the following python code
print(“Welcome to my School”.find(“my”,4))
a. 09
b. 10
c. 11
d. 12
56. Which of the following is known as mapping data type?
a. List
b. Dictionary
c. Tuple
d. String
57. What will be the output of the following python code.
str1 = “Welcome to my School”
str1.index(“School”)
a. Value Error
b. No Output
c. Syntax Error
d. None of the above
58. The third parameter of a slice operation can also be used to specify the _________.
a. Step Size
b. Indexing
c. Both a) and b)
d. None of the above
59. What will be the output of the following python code.
print(“Welcome to my School”.count(“m”,0))
a. 0
b. 1
c. 2
d. 3
String in Python Class 11 MCQ
60. The reverse string will be returned by which of the following?
a. str[::1]
b. str[::-1]
c. Both a) and b)
d. None of the above
61. What will be the output of the following python code.
str1 = “Python”
print(str1.find(‘h’))
a. 3
b. 5
c. 2
d. 6
62. What will be the output of the following python code.
str1=”Python”
print(str1.islower())
a. Error
b. True
c. False
d. None of the above
63. What will be the output of the following python code.
str1=”PYTHON”
print(str1.title())
a. PYTHON
b. pYTHON
c. Python
d. None of the above
64. What will be the output of the following python code.
str1=”Python Python Python Python”
print(str1.count(“Python”))
a. 3
b. 4
c. 5
d. 6
String in Python Class 11 MCQ
65. What will be the output of the following python code.
print(“$”.join(“Python”))
a. p$y$t$h$o$n
b. P$y$t$h$o$n
c. $p$y$t$h$o$n
d. $P$y$t$h$o$n
66. Which of the python function return Boolean value?
a. index()
b. find()
c. endwith()
d. None of the above
67. The word(s) separated by the specified substring are returned by the split() function.
a. Tuple
b. List
c. Dictionary
d. None of the above
68. When using the split() method, words are separated by ______ if a delimiter is not provided.
a. Semi colon
b. Comma
c. Colon
d. Space
omputer Science Class 11 Notes
- Unit 1 : Basic Computer Organisation
- Unit 1 : Encoding Schemes and Number System
- Unit 2 : Introduction to problem solving
- Unit 2 : Getting Started with Python
- Unit 2 : Conditional statement and Iterative statements in Python
- Unit 2 : Function in Python
- Unit 2 : String in Python
- Unit 2 : Lists in Python
- Unit 2 : Tuples in Python
- Unit 2 : Dictionary in Python
- Unit 3 : Society, Law and Ethics
Computer Science Class 11 MCQ
- Unit 1 : Basic Computer Organisation
- Unit 1 : Encoding Schemes and Number System
- Unit 2 : Introduction to problem solving
- Unit 2 : Getting Started with Python
- Unit 2 : Conditional statement and Iterative statements in Python
- Unit 2 : Function in Python
- Unit 2 : String in Python
- Unit 2 : Lists in Python
- Unit 2 : Tuples in Python
- Unit 2 : Dictionary in Python
- Unit 3 : Society, Law and Ethics
Computer Science Class 11 NCERT Solutions
- Unit 1 : Basic Computer Organisation
- Unit 1 : Encoding Schemes and Number System
- Unit 2 : Introduction to problem solving
- Unit 2 : Getting Started with Python
- Unit 2 : Conditional statement and Iterative statements in Python
- Unit 2 : Function in Python
- Unit 2 : String in Python
- Unit 2 : Lists in Python
- Unit 2 : Tuples and Dictionary in Python
- Unit 3 : Society, Law and Ethics