CBSE Class 11 Computer Science String and Function MCQs

Practice CBSE Class 11 Computer Science String and Function MCQs provided below. The MCQ Questions for Class 11 String and Function Computer Science with answers and follow the latest CBSE/ NCERT and KVS patterns. Refer to more Chapter-wise MCQs for CBSE Class 11 Computer Science and also download more latest study material for all subjects

MCQ for Class 11 Computer Science String and Function

Class 11 Computer Science students should review the 50 questions and answers to strengthen understanding of core concepts in String and Function

String and Function MCQ Questions Class 11 Computer Science with Answers

Question. What is the output of the following code ?
example = “snow world”
example[3] = ‘s’
print (example)
(a) snow
(b) snow world
(c) Error 
(d) snos world

Answer : C

Question. What will be the output of the following programming code?
x=”AmaZing”
print(x[3:],”and”,x[:2])
(a) Amazing and ZI
(b) aZing and Zin
(c) Zing and Am 
(d) Azing and zin

Answer : C

Question. Given a string example=”hello” what is the output of example.count(‘l’)
(a) 2 
(b) 1
(c) None
(d) 0

Answer : A

Question. Suppose s is “\t\tWorld\n”, what is s.strip() ?
(a) \t\tWorld\n
(b) \t\tWorld\n
(c) \t\tWORLD\n
(d) World 

Answer : D

Question. What is the output of the following?
print(“xyyzxyzxzxyy”.endswith(“xyy”, 0, 2))
(a) 0
(b) 1
(c) True
(d) False 

Answer : D

Question. What is the output of the following?
print(‘a B’.isalpha())
(a) True
(b) False 
(c) None
(d) Error

Answer : B

Question. What is the output of the following?
print(‘abcdef12’.replace(‘cd’, ’12’))
(a) ab12ef12 
(b) abcdef12
(c) ab12efcd
(d) none of the mentioned

Answer : A

Question. What is the output of the following?
print(‘Ab!2’.swapcase())
(a) AB!@
(b) ab12
(c) aB!2 
(d) aB1@

Answer : C

Question. The__________ function returns the exact copy of the string with the first letter in uppercase
(a) find()
(b) copy()
(c) upper()
(d) capitalize() 

Answer : D

Question. What is the output of the following code
example = “helle”
example.find(“e”)
(a) Error
(b) -1
(c) 1 
(d) 0

Answer : C

Question. What is the output of the following?
print(“xyyzxyzxzxyy”.count(‘xyy’, 2, 11))
(a) 2
(b) 0 
(c) 1
(d) error

Answer : B

Question. What is the output of the following?
print(“xyyzxyzxzxyy”.endswith(“xyy”))
(a) 1 
(b) True
(c) 3
(d) 2

Answer : A

Question. What is the output of the following?
print(‘ab’.isalpha())
(a) True 
(b) False
(c) None
(d) Error

Answer : A

Question. What is the output of the following?
print(‘abcdefcdghcd’.split(‘cd’))
(a) [‘ab’, ‘ef’, ‘gh’].
(b) [‘ab’, ‘ef’, ‘gh’, ”] 
(c) (‘ab’, ‘ef’, ‘gh’)
(d) (‘ab’, ‘ef’, ‘gh’, ”)

Answer : B

Question. Raju was solving a puzzle in which he wants to count the number of spaces.
Help him to complete
the following code
str1=input(“Enter the string”)
_________________________ // Statement 1
(a) print(str1.count(‘ ‘) + 1) 
(b) print(str1.count(‘ ‘) )
(c) print(str1.cnt(‘’))
(d) print(str1.cnt(‘’)+1

Answer : A

Question. Find the output of the following
word=”green vegetables”
print(word.find(‘veg’,2)
(a) 8
(b) 6 
(c) 10
(d) 12

Answer : B

Question. What is the output of the following code ?
example=”helloworld”
example[::-1].startswith(“d”)
(a) dlrowolleh
(b) True 
(c) -1
(d) None

Answer : B

Question. What is “Hello”.replace(“l”, “e”)
(a) Heeeo 
(b) Heelo
(c) Heleo
(d) None

Answer : A

Question. What is the output of the following?
print(‘ab12’.isalnum())
(a) True 
(b) False
(c) None
(d) Error

Answer : A

Question. What is the output of the following?
print(‘ ‘.isdigit())
(a) True
(b) False 
(c) None
(d) Error

Answer : B

Question. What is the output of the following?
print(‘abcdefcdghcd’.split(‘cd’, 0))
(a) [‘abcdefcdghcd’] 
(b) ‘abcdefcdghcd’
(c) error
(d) none of the mentioned

Answer : A

Question. What is the output of the following?
print(‘ab cd ef’.title())
(a) Ab cd ef
(b) Ab cd eF
(c) Ab Cd Ef 
(d) None of the mentioned

Answer : C

Question. How many times is the word “HELLO” printed in the following statement?
s=’python rocks’
for ch in s[3:8]:
print(‘Hello’ )
(a) 6
(b) 5 
(c) infinite
(d) 8

Answer : B

Question. What is the output of the following?
print(‘ab,12’.isalnum())
(a) True
(b) False 
(c) None
(d) Error

Answer : B

Question. What is the output of the following?
print(”’ \tfoo”’.lstrip())
(a) \tfoo
(b) foo 
(c) foo
(d) none of the mentioned

Answer : B

Question. What is the output of the following code
example = “helle”
example.rfind(“e”)
(a) -1
(b) 4 
(c) 3
(d) 1

Answer : B

Question. What will be the output of the following code
Msg=”CompuTer”
Msg1=”
for i in range(0, len(Msg)):
if Msg[i].isupper():
Msg1=Msg1+Msg[i].lower()
elif i%2==0:
Msg1=Msg1+’*’
else:
Msg1=Msg1+Msg[i].upper()
print(Msg1)
(a) cO*P*t*R 
(b) Co*p*t*R
(c) co*p*t*r
(d) cOP*tR

Answer : A

Question. What is the output of the following?
print(“abcdef”.find(“cd”) == “cd” in “abcdef”)
(a) True
(b) False 
(c) Error
(d) None of the mentioned

Answer : B

Question. What is the output of the following?
print(‘a@ 1,’.islower())
(a) True 
(b) False
(c) None
(d) Error

Answer : A

Question. myTuple = (“Joe”, “Peter”, “Vicky”)
x = “#”.join(myTuple)
print(x) will produce output
(a) Joe#Peter#Vicky 
(b) #JoePeterVicky
(c) JoePeterVicky
(d) JohnPete#Vicky#

Answer : A

Consider the string str=”Green Revolution” choose the correct statements in the python to implement the following in question a to c.

Question. Display last four characters
(a) str[-4:]
(b) str[:-4:]
(c) str[::]
(d) str[::-4] 

Answer : A

Question. To check whether the string contains ‘vol’ or not
(a) ‘vol’ in str 
(b) ‘vol’==str
(c) vol=str
(d) All of the above 

Answer : A

Question. To display the starting index for the substring ‘vo’
(a) str.disp(‘vo’)
(b) str.startind(‘vo’)
(c) str.find(‘vo’) 
(d) None of the above

Answer : C

Case Based Questions on String data type in Python

Q.36 Statement (1) As we know that strings are immutable. We cannot delete or remove the characters from the string.
Statement (2) But we can delete the entire string using the del keyword
(a) Statement 1 and Statement 2 both are true 
(b) Both statement 1 and 2 are false
(c) statement 1 is false and Statement 2 is true
(d) statement 1 is true and Statement 2 is false

Answer : A

Question. Consider the following case and write the code for the same.
Given a string. Cut it into two “equal” parts (If the length of the string is odd, place the center character in the first string, so that the first string contains one more characther than the second). Now print a new string on a single row with the first and second half interchanged (second half first and the first half second)
s = input()
______________________ //Fill in the statement
(a) print(s[(len(s) + 1) // 2:] + s[:(len(s) + 1) // 2 
(b) print(s[(len(s) + 1) // 2:]
(c) s[:(len(s) + 1) // 2
(d) None of the above

Answer : A

Question. (A) Assertion str1=”Hello” and str1=”World” then print(str1*3) will give error
(R) Reason : * replicates the string hence correct output will be
HelloHelloHello
(a) A is true but R is false
(b) A is true but R is not correct explanation of A
(c) A and B both are false
(d) A is false and R is correct 

Answer : D

Question. (A) Assertion :
a = “Hello”
b = “llo”
c = a – b
print(c)
This will lead to output He
(R) Reason : Python string does not support – operator
(a) A is true but R is false
(b) A is true but R is not correct explanation of A
(c) A and B both are false
(d) A is false and R true 

Answer : D

Question. (A) Assertion str1=”Hello” and str1=”World” then print(‘wo’ not in str) will print false
(R) Reason : not in returns true if a particular substring is not present in the specified string.
(a) A is true but R is false
(b) A is true and R is correct explanation of A 
(c) A and B both are false
(d) A is true but R is not correct explanation of A

Answer : B

Question. (A) Assertion : b = “Hello, World!” print(b[:5]) will give output “Hello”
(R) Reason : This will give get the characters from start position(5 not included)
(a) A is true but R is false
(b) A is true and R is correct explanation of A 
(c) A and B both are false
(d) A is true but R is not correct explanation of A

Answer : B

Question. (A) Assertion : You will get an error if you use double quotes inside a string that is surrounded by double quotes: txt = “We are the so-called “Vikings” from the north.”
(R) Reason : To fix this problem, use the escape character \”:
(a) A is true but R is false
(b) A is true but R is not correct explanation of A
(c) A and B both are false
(d) A is True and R is correct explanation of A 

Answer : D

MCQs for String and Function Computer Science Class 11

Students can use these MCQs for String and Function to quickly test their knowledge of the chapter. These multiple-choice questions have been designed as per the latest syllabus for Class 11 Computer Science released by CBSE. Our expert teachers suggest that you should practice daily and solving these objective questions of String and Function to understand the important concepts and better marks in your school tests.

String and Function NCERT Based Objective Questions

Our expert teachers have designed these Computer Science MCQs based on the official NCERT book for Class 11. We have identified all questions from the most important topics that are always asked in exams. After solving these, please compare your choices with our provided answers. For better understanding of String and Function, you should also refer to our NCERT solutions for Class 11 Computer Science created by our team.

Online Practice and Revision for String and Function Computer Science

To prepare for your exams you should also take the Class 11 Computer Science MCQ Test for this chapter on our website. This will help you improve your speed and accuracy and its also free for you. Regular revision of these Computer Science topics will make you an expert in all important chapters of your course.

Where can I download latest CBSE MCQs for Class 11 Computer Science String and Function

You can download the CBSE MCQs for Class 11 Computer Science String and Function for latest session from StudiesToday.com

Are the Class 11 Computer Science String and Function MCQs available for the latest session

Yes, the MCQs issued by CBSE for Class 11 Computer Science String and Function have been made available here for latest academic session

Where can I find CBSE Class 11 Computer Science String and Function MCQs online?

You can find CBSE Class 11 Computer Science String and Function MCQs on educational websites like studiestoday.com, online tutoring platforms, and in sample question papers provided on this website.

How can I prepare for String and Function Class 11 MCQs?

To prepare for String and Function MCQs, refer to the concepts links provided by our teachers and download sample papers for free.

Are there any online resources for CBSE Class 11 Computer Science String and Function?

Yes, there are many online resources that we have provided on studiestoday.com available such as practice worksheets, question papers, and online tests for learning MCQs for Class 11 Computer Science String and Function