Python Quiz Online Test Mcqs

Python is a programming language and through this quiz, you will be able to learn various basic information about it. It contains questions answers related to its basic functionality and usage which makes this quiz not only very informative but also fun to attempt.

Python Quiz Online Test Mcqs Questions with Answers Objective Type

 

Question 1 of 20

1. What is the output when following code is executed ?

>>>str1="helloworld"

>>>str1[::-1]

Question 1 of 20

Question 2 of 20

2. The output of executing string.ascii_letters can also be achieved by?

Question 2 of 20

Question 3 of 20

3. What is the output when following statement is executed ?

>>>"a"+"bc"

Question 3 of 20

Question 4 of 20

4. What is the output when following code is executed ?

>>>print r"\nhello"

The output is?

Question 4 of 20

Question 5 of 20

5. Given a function that does not return any value, What value is thrown by itby default when executed in shell?

Question 5 of 20

Question 6 of 20

6. Print 0xA + 0xB + 0xC ?

Question 6 of 20

Question 7 of 20

7. What error occurs when you execute?
apple = mango

Question 7 of 20

Question 8 of 20

8. What is the output when following statement is executed ?

>>>print 'new' 'line'

Question 8 of 20

Question 9 of 20

9. What is the output when following statement is executed ?

>>>"abcd"[2:]

Question 9 of 20

Question 10 of 20

10. What is the output of the following?

x = 'abcd'
for i in range(x):
print(i)

Question 10 of 20

Question 11 of 20

11. Which of these in not a core datatype?

Question 11 of 20

Question 12 of 20

12. What is the output of the following?

x = 'abcd'
for i in range(len(x)):
print(x)
x = 'a'

Question 12 of 20

Question 13 of 20

13. What is the output of the following?

x = 'abcd'
for i in x:
print(i)
x.upper()

Question 13 of 20

Question 14 of 20

14. What is the output when following code is executed ?

>>> str1 = 'hello'

>>> str2 = ','

>>> str3 = 'world'

>>> str1[-1:]

Question 14 of 20

Question 15 of 20

15. Following set of commands are executed in shell, what will be the output?

>>>str="hello"

>>>str[:2]

>>>

Question 15 of 20

Question 16 of 20

16. What is the output of the following?

print("xyyzxyzxzxyy".count('yy'))

Question 16 of 20

Question 17 of 20

17. What is the output of the following?

x = 'abcd'
for i in x:
print(i.upper())

Question 17 of 20

Question 18 of 20

18. What arithmetic operators cannot be used with strings ?

Question 18 of 20

Question 19 of 20

19. What is the return type of function id ?

Question 19 of 20

Question 20 of 20

20. What is the output when following statement is executed ?

>>>print '\x97\x98'

Question 20 of 20


 

You Can Learn and Gain more Knowledge through our Online Quiz and Testing system Just Search your desired Preparation subject at Gotest.
You might also like
Comments