This Quiz contains totally 10 Questions each carry 1 point for you.
1.What will be the output of the following Python code?
print("xyyzxyzxzxyy".endswith("xyy"))
1
True
3
2
Correct!
Wrong!
2.s = 'foo'
t = 'bar'
print('barf' in 2 * (s + t))
What is the output of Print function?
True
False
Correct!
Wrong!
3.What is the output of the following code?
var1 = 'tutorials'
print( 'i2' + var1[:8] )
I2tutorials
I2 tutorials
I2tutorial
I2 tutorial
Correct!
Wrong!
4.What will be the output of the following Python code?
print("abc DEF".capitalize())
abc def
ABC DEF
Abc def
Abc Def
Correct!
Wrong!
5.What will be the output of the following Python code?
print("Hello {0} and {1}".format('i2', 'tutorials'))
Hello i2 and tutorials
Hello tutorials and i2
Error
None of the mentioned
Correct!
Wrong!
6.s = 'foobar'
All of the following expressions produce the same result except one. Which one?
s[0] + s[-1]
s[::5]
s[::-5]
s[::-1][-1] + s[len(s)-1]
Correct!
Wrong!
7.what is the output of the following code?
str='i2 Tutorials'
print (str[::-1])
i2
i2 Tutorials
Tutorials i2
slairotuT 2i
Correct!
Wrong!
8.The index of strings starts with______
1
0
-1
-0
Correct!
Wrong!
9.What is the output of “hello”+1+2+3 ?
hello123
error
hello
hello6
Correct!
Wrong!
10.What is the output of the following?
print('1.1'.isnumeric())
True
False
None
Error
Correct!
Wrong!
Share the quiz to show your results !
Subscribe to see your results
Ignore & go to results
Python-Srtings-Quiz
You got %%score%% of %%total%% right
%%description%%
%%description%%
Loading...