{"id":1202,"date":"2021-08-31T14:17:00","date_gmt":"2021-08-31T08:47:00","guid":{"rendered":"https:\/\/cbsepython.in\/?p=1202"},"modified":"2025-06-26T23:01:25","modified_gmt":"2025-06-26T17:31:25","slug":"mcqs-on-string-and-function-for-class-11","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/mcqs-on-string-and-function-for-class-11\/","title":{"rendered":"MCQs on String and function for class 11"},"content":{"rendered":"<h3><span style=\"color: #000000;\">MCQs on String and function for class 11<\/span><\/h3>\n<p><span style=\"color: #000000;\">STRING AND BUILT IN FUNCTION<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.1 What is the output of the following code ?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">example = &#8220;snow world&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">example[3] = &#8216;s&#8217;<\/span><\/p>\n<p><span style=\"color: #000000;\">print (example)<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) snow <\/span><\/p>\n<p><span style=\"color: #000000;\">(b) snow world <\/span><\/p>\n<p><span style=\"color: #000000;\">(c) Error <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(d) snos world<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Consider the string str=\u201dGreen Revolution\u201d choose the correct statements in <\/span><span style=\"color: #000000;\">the python to implement the following in question 2 to 4.<\/span><\/p>\n<p><strong><span style=\"color: #000000;\">Q.2 Display last four characters<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">(a) str[-4:]<strong>\u2713<\/strong> <\/span><\/p>\n<p><span style=\"color: #000000;\">(b) str[:-4:] <\/span><\/p>\n<p><span style=\"color: #000000;\">(c) str[::] <\/span><\/p>\n<p><span style=\"color: #000000;\">(d) str[::-4]<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.3 To display the starting index for the substring \u2018vo\u2019<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">(a) str.disp(\u2018vo\u2019)<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) str.startind(\u2018vo\u2019)<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) str.find(\u2018vo\u2019) <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(d) None of the above<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.4 To check whether the string contains \u2018vol\u2019 or not<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">(a) \u2018vol\u2019 in str <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) \u2018vol\u2019==str<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) vol=str<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) All of the above<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.5 What will be the output of the following programming code?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">x=\u201dAmaZing\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\">print(x[3:],\u201dand\u201d,x[:2])<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) Amazing and ZI<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) aZing and Zin<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) Zing and Am <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(d) Azing and zin<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.6 The__________ function returns the exact copy of the string with the first <\/span><span style=\"color: #000000;\">letter in uppercase<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">(a) find()<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) copy()<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) upper()<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) capitalize() <strong>\u2713<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.7 How many times is the word \u201cHELLO\u201d printed in the following statement?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">s=\u2019python rocks\u2019<\/span><\/p>\n<p><span style=\"color: #000000;\">for ch in s[3:8]:<\/span><\/p>\n<p><span style=\"color: #000000;\">print(\u2018Hello\u2019 )<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) 6<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) 5 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) infinite<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) 8<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.8 Find the output of the following<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">word=\u201dgreen vegetables\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\">print(word.find(\u2018veg\u2019,2)<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) 8<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) 6 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) 10<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) 12<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.9 Given a string example=\u201dhello\u201d what is the output of example.count(\u2018l\u2019)<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">(a) 2 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) 1<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) 0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.10 What is the output of the following code<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">example = &#8220;helle&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">example.find(&#8220;e&#8221;)<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) Error<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) -1<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) 1 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(d) 0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.11 What is the output of the following code<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">example = &#8220;helle&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">example.rfind(&#8220;e&#8221;)<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) -1<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) 4 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) 3<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) 1\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.12 What is the output of the following code ?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">example=&#8221;helloworld&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">example[::-1].startswith(&#8220;d&#8221;)<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) dlrowolleh<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) True <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) -1<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) None<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.13 Suppose s is \u201c\\t\\tWorld\\n\u201d, what is s.strip() ?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">(a) \\t\\tWorld\\n<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) \\t\\tWorld\\n<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) \\t\\tWORLD\\n<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) World <strong>\u2713<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.14 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8220;xyyzxyzxzxyy&#8221;.count(&#8216;xyy&#8217;, 2, 11))<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) 2<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) 0 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) 1<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) error<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.15 What will be the output of the following code<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">Msg=&#8221;CompuTer&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">Msg1=&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">for i in range(0, len(Msg)):<\/span><\/p>\n<p><span style=\"color: #000000;\">if Msg[i].isupper():<\/span><\/p>\n<p><span style=\"color: #000000;\">Msg1=Msg1+Msg[i].lower()<\/span><\/p>\n<p><span style=\"color: #000000;\">elif i%2==0:<\/span><\/p>\n<p><span style=\"color: #000000;\">Msg1=Msg1+&#8217;*&#8217;<\/span><\/p>\n<p><span style=\"color: #000000;\">else:<\/span><\/p>\n<p><span style=\"color: #000000;\">Msg1=Msg1+Msg[i].upper()<\/span><\/p>\n<p><span style=\"color: #000000;\">print(Msg1)<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) cO*P*t*R <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) Co*p*t*R<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) co*p*t*r<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) cOP*tR<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.16 What is \u201cHello\u201d.replace(\u201cl\u201d, \u201ce\u201d)<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">(a) Heeeo <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) Heelo<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) Heleo<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) None<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.17 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8220;xyyzxyzxzxyy&#8221;.endswith(&#8220;xyy&#8221;))<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) 1 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) True<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) 3<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) 2<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.18 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8220;xyyzxyzxzxyy&#8221;.endswith(&#8220;xyy&#8221;, 0, 2))<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) 0<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) 1<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) True<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) False <strong>\u2713<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.19 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8220;abcdef&#8221;.find(&#8220;cd&#8221;) == &#8220;cd&#8221; in &#8220;abcdef&#8221;)<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) True<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) False <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) Error<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) None of the mentioned<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.20 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;ab12&#8217;.isalnum())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) True <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) False<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) Error<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.21 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;ab,12&#8217;.isalnum())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) True<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) False <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) Error\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.22 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;ab&#8217;.isalpha())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) True <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) False<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) Error<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.23 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;a B&#8217;.isalpha())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) True<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) False <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) Error<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.24 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216; &#8216;.isdigit())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) True<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) False <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) Error<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.25 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;a@ 1,&#8217;.islower())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) True <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) False<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) None<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) Error<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.26 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8221;&#8217; \\tfoo&#8221;&#8217;.lstrip())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) \\tfoo<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) foo <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) foo<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) none of the mentioned<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.27 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;abcdef12&#8217;.replace(&#8216;cd&#8217;, &#8217;12&#8217;))<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) ab12ef12 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) abcdef12<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) ab12efcd<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) none of the mentioned<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.28 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;abcdefcdghcd&#8217;.split(&#8216;cd&#8217;))<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) [\u2018ab\u2019, \u2018ef\u2019, \u2018gh\u2019].<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) [&#8216;ab&#8217;, &#8216;ef&#8217;, &#8216;gh&#8217;, &#8221;] <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) (\u2018ab\u2019, \u2018ef\u2019, \u2018gh\u2019)<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) (\u2018ab\u2019, \u2018ef\u2019, \u2018gh\u2019, \u201d)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.29 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;abcdefcdghcd&#8217;.split(&#8216;cd&#8217;, 0))<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) [\u2018abcdefcdghcd\u2019] <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) \u2018abcdefcdghcd\u2019\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) error<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) none of the mentioned<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.30 myTuple = (&#8220;Joe&#8221;, &#8220;Peter&#8221;, &#8220;Vicky&#8221;)<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">x = &#8220;#&#8221;.join(myTuple)<\/span><\/p>\n<p><span style=\"color: #000000;\">print(x) will produce output<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) Joe#Peter#Vicky <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) #JoePeterVicky<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) JoePeterVicky<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) JohnPete#Vicky#<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.31 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;Ab!2&#8217;.swapcase())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) AB!@<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) ab12<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) aB!2 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(d) aB1@<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.32 What is the output of the following?<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">print(&#8216;ab cd ef&#8217;.title())<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) Ab cd ef<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) Ab cd eF<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) Ab Cd Ef <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(d) None of the mentioned<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000;\">Q.33 Raju was solving a puzzle in which he wants to count the number of spaces.<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">Help him to complete<\/span><\/p>\n<p><span style=\"color: #000000;\">the following code<\/span><\/p>\n<p><span style=\"color: #000000;\">str1=input(\u201cEnter the string\u201d)<\/span><\/p>\n<p><span style=\"color: #000000;\">_________________________ \/\/ Statement 1<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) print(str1.count(&#8216; &#8216;) + 1) <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) print(str1.count(&#8216; &#8216;) )<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) print(str1.cnt(\u2018\u2019))<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) print(str1.cnt(\u2018\u2019)+1<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2>Case Based Questions on String data type in Python<\/h2>\n<p><strong><span style=\"color: #000000;\">Q.34 Consider the following case and write the code for the same.<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">Given a string. Cut it into two &#8220;equal&#8221; parts (If the length of the string <\/span><span style=\"color: #000000;\">is odd, place the center character in the first string, so that the first <\/span><span style=\"color: #000000;\">string contains one more characther than the second). Now print a\u00a0<\/span><span style=\"color: #000000;\">new string on a single row with the first and second half <\/span><span style=\"color: #000000;\">interchanged (second half first and the first half second)<\/span><\/p>\n<p><span style=\"color: #000000;\">s = input()<\/span><\/p>\n<p><span style=\"color: #000000;\">______________________ \/\/Fill in the statement<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) print(s[(len(s) + 1) \/\/ 2:] + s[:(len(s) + 1) \/\/ 2 <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) print(s[(len(s) + 1) \/\/ 2:]<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) s[:(len(s) + 1) \/\/ 2<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) None of the above<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Q.35 (A) Assertion : b = &#8220;Hello, World!&#8221; print(b[:5]) will give output \u201cHello\u201d<\/span><\/p>\n<p><span style=\"color: #000000;\">(R) Reason : This will give get the characters from start position(5 not <\/span><span style=\"color: #000000;\">included)<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) A is true but R is false<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) A is true and R is correct explanation of A <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) A and B both are false<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) A is true but R is not correct explanation of A<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Q.36 Statement (1) As we know that strings are immutable. We cannot delete or <\/span><span style=\"color: #000000;\">remove the characters from the string.<\/span><\/p>\n<p><span style=\"color: #000000;\">Statement (2) But we can delete the entire string using the del keyword<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) Statement 1 and Statement 2 both are true <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(b) Both statement 1 and 2 are false<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) statement 1 is false and Statement 2 is true<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) statement 1 is true and Statement 2 is false<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Q.37 (A) Assertion :<\/span><\/p>\n<p><span style=\"color: #000000;\">a = &#8220;Hello&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">b = &#8220;llo&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">c = a &#8211; b<\/span><\/p>\n<p><span style=\"color: #000000;\">print(c)<\/span><\/p>\n<p><span style=\"color: #000000;\">This will lead to output He<\/span><\/p>\n<p><span style=\"color: #000000;\">(R) Reason : Python string does not support &#8211; operator<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) A is true but R is false<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) A is true but R is not correct explanation of A<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) A and B both are false<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) A is false and R true <strong>\u2713<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Q.38 (A) Assertion : You will get an error if you use double quotes inside a string <\/span><span style=\"color: #000000;\">that is surrounded by double quotes: txt = &#8220;We are the so-called &#8220;Vikings&#8221; <\/span><span style=\"color: #000000;\">from the north.&#8221;<\/span><\/p>\n<p><span style=\"color: #000000;\">(R) Reason : To fix this problem, use the escape character \\&#8221;:<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) A is true but R is false<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) A is true but R is not correct explanation of A<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) A and B both are false<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) A is True and R is correct explanation of A <strong>\u2713<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Q.39 (A) Assertion str1=\u201dHello\u201d and str1=\u201dWorld\u201d then print(str1*3) will give <\/span><span style=\"color: #000000;\">error<\/span><\/p>\n<p><span style=\"color: #000000;\">(R) Reason : * replicates the string hence correct output will be<\/span><\/p>\n<p><span style=\"color: #000000;\">HelloHelloHello<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) A is true but R is false<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) A is true but R is not correct explanation of A<\/span><\/p>\n<p><span style=\"color: #000000;\">(c) A and B both are false<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) A is false and R is correct <strong>\u2713<\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000;\">Q.40 (A) Assertion str1=\u201dHello\u201d and str1=\u201dWorld\u201d then print(\u2018wo\u2019 not in str) will <\/span><span style=\"color: #000000;\">print false<\/span><\/p>\n<p><span style=\"color: #000000;\">(R) Reason : not in returns true if a particular substring is not present in the <\/span><span style=\"color: #000000;\">specified string.<\/span><\/p>\n<p><span style=\"color: #000000;\">(a) A is true but R is false<\/span><\/p>\n<p><span style=\"color: #000000;\">(b) A is true and R is correct explanation of A <strong>\u2713<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">(c) A and B both are false<\/span><\/p>\n<p><span style=\"color: #000000;\">(d) A is true but R is not correct explanation of A<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MCQs on String and function for class 11 STRING AND BUILT IN FUNCTION &nbsp; Q.1 What is the output of the following code ? example = &#8220;snow world&#8221; example[3] = &#8216;s&#8217; print (example) (a) snow (b) snow world (c) Error \u2713 (d) snos world &nbsp; Consider the string str=\u201dGreen Revolution\u201d choose the correct statements in [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-1202","post","type-post","status-publish","format-standard","hentry","category-cbse-computer-science-with-python-class-12"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/1202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/comments?post=1202"}],"version-history":[{"count":1,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/1202\/revisions"}],"predecessor-version":[{"id":5347,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/1202\/revisions\/5347"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=1202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=1202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=1202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}