You Scored:
Ranking:
Python Quiz Test Online MCQs Questions Answers
1. What is the output of the following?
print("xyyzxyzxzxyy".count('yy'))
2 (Answer)
None of the mentioned
0
Error
2. What is the output when following statement is executed ?
>>>"a"+"bc"
a
abc (Answer)
bca
bc
3. What is the output of the following?
x = 'abcd'
for i in x:
print(i.upper())
a b c d
A B C D (Answer)
a B C D
error
4. Following set of commands are executed in shell, what will be the output?
>>>str="hello"
>>>str[:2]
>>>
olleh
he (Answer)
lo
hello
5. What is the output when following code is executed ?
>>>print r"\nhello"
The output is?
\nhello (Answer)
A new line and hello
Error
The letter r and then hello
6. The output of executing string.ascii-letters can also be achieved by?
String.letters
String.ascii-lowercase-string.digits
String.lowercase-string.upercase
String.ascii-lowercase+string.ascii-upercase (Answer)
7. What is the output of the following?
x = 'abcd'
for i in range(x):
print(i)
error (Answer)
a b c d
none of the mentioned
0 1 2 3
8. Print 0xA + 0xB + 0xC ?
33 (Answer)
Error
OxA0xB0xC
0x22
9. What arithmetic operators cannot be used with strings ?
Both C & D (Answer)
**
–
*
+
10. What is the output when following code is executed ?
>>>str1="helloworld"
>>>str1[::-1]
Hello
Helloworld
World
Dlrowolleh (Answer)
Many of the best language software with c# programming language and all other latest programming languages McQs are with answers. Easy programming languages are high level languages. Here best coding language to learn with best programming language to learn. With using MCQs you can easily learn Programming Languages. How to learn programming language here MCQs for computer programming languages for beginners.