String MCQ Test
String MCQ Test
Which of the following will be correct output if the given expression is evaluated?
(a) Hell* World (b) Hell* W*rld (c) Hello W*rld (d) Error
16. STRING=“WELCOME” Line1
NOTE= “ ” Line2
for S in range[0,8]: Line3
print(STRING[S]) Line4
print(S STRING) Line5
20.If the following code is executed, what will be the output of the following
code?
27. What arithmetic operators cannot be used with 32 What will be the output of the
strings? . following Python code?
a) + b) * c) – d) All of the mentioned
>>>example = "snow world"
>>>print("%s" % example[4:7])
a) wo b) world c) sn d) rl
28. What will be the output of the following Python code? 33 What will be the output of the
. following Python code?
>>>max("what are you")
>>>example = "helle"
>>>example.find("e")
29. What will be the output of the following Python code? 34 What will be the output of the
. “hello” +1+2+3?
a) hello123 b) hello c) Error d)
>>>example="helloworld" hello6
>>>example[::-1].startswith("d")
30. What is “Hello”.replace(“l”, “e”)? 35 What will be the output of the
a) Heeeo b) Heelo c) Heleo d) None . following Python code?
print("abc DEF".capitalize())
a) abc def
b) ABC DEF
c) Abc def
d) Abc Def
2 marks
1. Write the output of the following code