MCQs on Introduction to Python | Python programming

1. Introduction to Python

  1. Which of the following is a core feature of Python?
    • a) Compilation
    • b) Interpreted language
    • c) Object-oriented only
    • d) Static typing
  2. What is Python primarily used for?
    • a) Web Development
    • b) Data Science
    • c) Scripting and Automation
    • d) All of the above
  3. Which company created Python?
    • a) Microsoft
    • b) Sun Microsystems
    • c) Google
    • d) None of the above
  4. Python is a:
    • a) Low-level programming language
    • b) High-level programming language
    • c) Machine-level language
    • d) Assembly language
  5. Who is considered the creator of Python?
    • a) Tim Berners-Lee
    • b) Guido van Rossum
    • c) Dennis Ritchie
    • d) James Gosling

2. History and Evolution of Python

  1. When was Python first released?
    • a) 1990
    • b) 1991
    • c) 2000
    • d) 1995
  2. What was Python’s predecessor language?
    • a) ABC
    • b) FORTRAN
    • c) Java
    • d) Perl
  3. Which version of Python introduced list comprehensions?
    • a) Python 2.0
    • b) Python 3.0
    • c) Python 2.5
    • d) Python 3.5
  4. In which year was Python 3 first released?
    • a) 2007
    • b) 2008
    • c) 2010
    • d) 2012
  5. Which major change was made when Python 3 was released?
    • a) Renamed the print statement to print()
    • b) Introduced the with statement
    • c) Dropped support for lists
    • d) Replaced all keywords with single letters

3. Features of Python

  1. What is the main advantage of Python over other programming languages?
    • a) Faster execution
    • b) Simplicity and readability
    • c) Strong memory management
    • d) All of the above
  2. Which feature of Python allows it to run on different operating systems?
    • a) High-level language
    • b) Interpreted nature
    • c) Platform independence
    • d) None of the above
  3. Which of the following is NOT a feature of Python?
    • a) Dynamic typing
    • b) Extensive standard library
    • c) Explicit memory management
    • d) Cross-platform compatibility
  4. What type of programming paradigm does Python support?
    • a) Object-oriented
    • b) Functional
    • c) Imperative
    • d) All of the above
  5. Python’s garbage collection mechanism is based on:
    • a) Reference counting
    • b) Mark-and-sweep algorithm
    • c) Stack management
    • d) All of the above

4. Python Installation and Setup

  1. Which of the following is a valid way to install Python on Windows?
    • a) Using an installer from python.org
    • b) Using the Linux package manager
    • c) Using Homebrew
    • d) Using pip
  2. On which platform can Python be installed?
    • a) Windows
    • b) Linux
    • c) macOS
    • d) All of the above
  3. After installing Python, which command can you use to check the version of Python?
    • a) python --version
    • b) python -v
    • c) python version
    • d) check python version
  4. Which tool is used to manage Python packages?
    • a) pip
    • b) easy_install
    • c) Conda
    • d) All of the above
  5. What is the extension of a Python file?
    • a) .py
    • b) .pyn
    • c) .python
    • d) .pt

5. Python IDEs and Text Editors

  1. Which of the following is a popular IDE for Python development?
    • a) Eclipse
    • b) IntelliJ IDEA
    • c) PyCharm
    • d) Xcode
  2. Which of the following text editors is commonly used for Python programming?
    • a) Visual Studio Code
    • b) Notepad++
    • c) Sublime Text
    • d) All of the above
  3. Which IDE is specifically built for Python and is widely recommended for beginners?
    • a) NetBeans
    • b) PyCharm
    • c) Sublime Text
    • d) Eclipse
  4. Which of the following is a web-based Python IDE?
    • a) Replit
    • b) Atom
    • c) Visual Studio
    • d) Xcode
  5. What does “IDLE” stand for in the context of Python?
    • a) Integrated Development and Learning Environment
    • b) Integrated Design Language Environment
    • c) Interactive Debugging and Learning Environment
    • d) Independent Development Environment for Learning

6. Running Python Programs

  1. What is the command to run a Python script from the command line?
    • a) python run script.py
    • b) python3 script.py
    • c) py run script.py
    • d) run script.py
  2. In which mode does Python execute scripts?
    • a) Interactive mode
    • b) Batch mode
    • c) Both
    • d) None of the above
  3. How do you execute a Python program on Windows?
    • a) Double-click the file
    • b) Use python <filename> in the command prompt
    • c) Open the file in any text editor and press the execute button
    • d) All of the above
  4. In interactive mode, what symbol appears at the prompt?
    • a) $
    • b) %
    • c) >>
    • d) #
  5. What happens when you run a Python script in interactive mode?
    • a) The code is executed line by line
    • b) The entire program is executed in one go
    • c) The program runs without output
    • d) The script is ignored

Answer Table:

QnoAnswer
1b) Interpreted language
2d) All of the above
3d) None of the above
4b) High-level programming language
5b) Guido van Rossum
6b) 1991
7a) ABC
8c) Python 2.5
9b) 2008
10a) Renamed the print statement to print()
11b) Simplicity and readability
12c) Platform independence
13c) Explicit memory management
14d) All of the above
15a) Reference counting
16a) Using an installer from python.org
17d) All of the above
18a) python --version
19d) All of the above
20a) .py
21c) PyCharm
22d) All of the above
23b) PyCharm
24a) Replit
25a) Integrated Development and Learning Environment
26b) python3 script.py
27c) Both
28b) Use python <filename> in the command prompt
29c) >>
30a) The code is executed line by line

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top