String in Python Class 11 MCQ

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

Show Answer ⟶
a. String

2. String can be a _________.
a. Letter
b. Digit
c. Whitespace & Symbol
d. All of the above 

Show Answer ⟶
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 

Show Answer ⟶
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

Show Answer ⟶
a. Indexing

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

Show Answer ⟶
b. [ ]

6. In the string, the index of the first character start from ______.
a. 0 
b. n-1
c. 1
d. None of the above

Show Answer ⟶
a. 0

7. In the string, the index of the last character ______.
a. 0
b. n-1 
c. 1
d. None of the above

Show Answer ⟶
b. n-1

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

Show Answer ⟶
b. IndexError

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

Show Answer ⟶
c. Welcome to my

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

Show Answer ⟶
a. Welcome to my School

11. A string is an _______ data type.
a. Mutable
b. Immutable t
c. Both a) and b)
d. None of the above

Show Answer ⟶
b. Immutable

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

Show Answer ⟶
b. String cannot be changed after it has been created

13. Concatenate means ______.
a. to Join 
b. to Divide
c. to Split
d. None of the above

Show Answer ⟶
a. to Join

14. Python allows us to join two strings using concatenation operator _______.
a. + +
b. + –
c. + 
d. None of the above

Show Answer ⟶
c. +

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. $

Show Answer ⟶
a. *

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

Show Answer ⟶
b. Indexing

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

Show Answer ⟶
c. Index Error

18. Python has two membership operators _______ and ______.
a. In and Out
b. In and Not 
c. True and False
d. None of the above

Show Answer ⟶
b. In and Not

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

Show Answer ⟶
c. Not in

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

Show Answer ⟶
b. Slicing

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

Show Answer ⟶
b. Left side

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

Show Answer ⟶
a. Immutable

23. String data types can perform _______ operations in Python.
a. Slicing
b. Concatenation
c. Membership
d. All of the above 

Show Answer ⟶
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

Show Answer ⟶
b. for and while loop

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

Show Answer ⟶
b. len()

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

Show Answer ⟶
b. split()

27. Following is an example of _________.
str1 = “cbseskilleducation.com”
a. String 
b. Dictionary
c. List
d. None of the above

Show Answer ⟶
a. String

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

Show Answer ⟶
b. Welcome to my School

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

Show Answer ⟶
c. title()

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

Show Answer ⟶
a. lower()

31. ________returns the string with all lowercase letters converted to uppercase.
a. lower()
b. upper() 
c. title()
d. None of the above

Show Answer ⟶
b. upper()

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

Show Answer ⟶
b. index(str, start, end)

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

Show Answer ⟶
c. endswith()

34. What will be the output of the following python code
str1=”WelcometomySchool”
print(len(str1))
a. 17 
b. 18
c. 19
d. 20 

Show Answer ⟶
a. 17

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

Show Answer ⟶
b. Welcome
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

Show Answer ⟶
a. isalnum()

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 

Show Answer ⟶
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

Show Answer ⟶
b. islower()

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()

Show Answer ⟶
a. isspace()

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()

Show Answer ⟶
b. strip()

41. ________ returns the string after removing the spaces only on the left of the string.
a. isspace()
b. istitle()
c. istrip() 
d. rstrip()

Show Answer ⟶
c. istrip()

42. ________ returns the string after removing the spaces only on the right of the string.
a. isspace()
b. istitle()
c. istrip()
d. rstrip() 

Show Answer ⟶
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

Show Answer ⟶
a. 3

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

Show Answer ⟶
b. Mython

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

Show Answer ⟶
a. Index Error

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

Show Answer ⟶
c. My Python

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

Show Answer ⟶
c. P
y
t
h
o
n

48. Which operator can be applied to both integer and string values?
a. * 
b. /
c. %
d. –

Show Answer ⟶
a. *

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

Show Answer ⟶
b. TypeError

String in Python Class 11 MCQ

50. Which operator is used to concatenate strings?
a. ++
b. + 
c. –
d. /

Show Answer ⟶
b. +

51. What will be the output of the following python code
print(len(“\\\@\\\/@”))
a. 6
b. 7 
c. 8
d. 9

Show Answer ⟶
b. 7

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

Show Answer ⟶
a.
*
**
***
****

53. What will be the output of the following python code
print(“Python”[2:3])
a. Error
b. h
c. t 
d. No Output

Show Answer ⟶
c. t

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

Show Answer ⟶
a. [‘P’, ‘y’, ‘t’, ‘h-o-n’]

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

Show Answer ⟶
c. 11

56. Which of the following is known as mapping data type?
a. List
b. Dictionary 
c. Tuple
d. String

Show Answer ⟶
b. Dictionary

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

Show Answer ⟶
b. No Output

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

Show Answer ⟶
a. Step Size

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

Show Answer ⟶
c. 2

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

Show Answer ⟶
b. str[::-1]

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

Show Answer ⟶
a. 3

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

Show Answer ⟶
c. False

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

Show Answer ⟶
c. Python

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

Show Answer ⟶
b. 4

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

Show Answer ⟶
b. 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

Show Answer ⟶
c. endwith()

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

Show Answer ⟶
b. List

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 

Show Answer ⟶
d. Space
omputer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer Science Class 11 Practical Questions and Answers

Leave a Comment

error: Content is protected !!