
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Variable Types
- Python - Basic Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
- Python Advanced Tutorial
- Python - Classes/Objects
- Python - Reg Expressions
- Python - CGI Programming
- Python - Database Access
- Python - Networking
- Python - Sending Email
- Python - Multithreading
- Python - XML Processing
- Python - GUI Programming
- Python - Further Extensions
- Python Useful Resources
- Python - Questions and Answers
- Python - Quick Guide
- Python - Tools/Utilities
- Python - Useful Resources
- Python - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Python. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Answer : D
Explanation
To strings connected by ‘in’ operator gives true and false.
Q 2 - What is the output of following code −
[ (a,b) for a in range(3) for b in range(a) ]
Answer : D
Explanation
This is nested for loop. The output of first for loop will be the value for the next loop.
Q 3 - In the following options which are python libraries which are used for data analysis and scientific computations
Answer : D
Explanation
Numpy,Scipy,pandas are few libraries in python which are used for data analysis and scientific computations.
Q 4 - What is output of following code −
def func(n): if(n==1): return 1; else: return(n+func(n-1)) print(func(4))
Answer : B
Q 5 - What command is used to insert 6 in a list ‘‘L’’ at 3rd position ?
Answer : A
Explanation
listname.insert(x,y) method is used to insert a item at certain position in a list. x defines position at which the element will be added and y defines the element to be added in the list.
Q 6 - What is the output of the following code?
eval(''1 + 3 * 2'')
Answer : D
Explanation
Eval is a method used to evaluate the values entered in the braces.
Q 7 - Suppose you are given a set(s1={1,2,3}) then what is the output for the code −
2 * s1?
Answer : C
Explanation
* cannot be operated on the sets.
Q 8 - How to create a frame in Python?
Answer : C
Explanation
Frame() method is used to make a frame in python.
Q 9 - Which way among them is used to create an event loop ?
Answer : B
Q 10 - Best part is you can display images in various options in Python. Select the option where you can display an image −