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 = 'hello'

>>> str2 = ','

>>> str3 = 'world'

>>> str1[-1:]

Question 1 of 20

Question 2 of 20

2. What arithmetic operators cannot be used with strings ?

Question 2 of 20

Question 3 of 20

3. What is the output of the following?

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

Question 3 of 20

Question 4 of 20

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

>>>"a"+"bc"

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. What is the output of the following?

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

Question 6 of 20

Question 7 of 20

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

>>>print 'new' 'line'

Question 7 of 20

Question 8 of 20

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

>>>print '\x97\x98'

Question 8 of 20

Question 9 of 20

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

>>>str="hello"

>>>str[:2]

>>>

Question 9 of 20

Question 10 of 20

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

>>>print r"\nhello"

The output is?

Question 10 of 20

Question 11 of 20

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

>>>str1="helloworld"

>>>str1[::-1]

Question 11 of 20

Question 12 of 20

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

Question 12 of 20

Question 13 of 20

13. What is the output of the following?

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

Question 13 of 20

Question 14 of 20

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

Question 14 of 20

Question 15 of 20

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

Question 15 of 20

Question 16 of 20

16. Which of these in not a core datatype?

Question 16 of 20

Question 17 of 20

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

>>>"abcd"[2:]

Question 17 of 20

Question 18 of 20

18. What is the return type of function id ?

Question 18 of 20

Question 19 of 20

19. What is the output of the following?

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

Question 19 of 20

Question 20 of 20

20. What is the output of the following?

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

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.

Maan Ali

Hey there! I'm Maan Ali, your online test prep pal. Join me in the adventure of acing exams with ease. I'll share tricks, practice tests, and all you need to rock your studies. Let's make learning fun and success a sure thing!

Your Related

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button