What is Python?
A
A snake species B
A database management system C
A high-level, interpreted programming language D
An operating system
Analysis & Theory
Python is a high-level, interpreted programming language known for its simplicity and readability.
Who developed Python programming language?
A
Dennis Ritchie B
Bjarne Stroustrup C
Guido van Rossum D
James Gosling
Analysis & Theory
Python was developed by Guido van Rossum and first released in 1991.
Which of the following is a correct Python file extension?
A
.pt B
.py C
.pyt D
.python
Analysis & Theory
Python files use the .py extension.
Which of the following is used to display output in Python?
A
echo B
print() C
disp() D
write()
Analysis & Theory
In Python, the print() function is used to display output.
Python is _____ typed language.
A
Statically B
Dynamically C
Manually D
Strongly
Analysis & Theory
Python is dynamically typed, meaning variable types are determined at runtime.
What does the Python interpreter do?
A
Converts code to machine language B
Converts Python code to Java C
Executes Python code line by line D
Compiles Python code to binary
Analysis & Theory
The Python interpreter executes Python code line by line, making it an interpreted language.
Which of the following is NOT a feature of Python?
A
Easy to read syntax B
Compiled language C
Interpreted language D
Supports object-oriented programming
Analysis & Theory
Python is not a compiled language; it is interpreted.
Which symbol is used to start a comment in Python?
A
// B
# C
/* D
--
Analysis & Theory
In Python, the hash symbol (#) is used to begin a comment.
What is the correct way to execute a Python script named 'script.py' from the terminal?
A
run script.py B
execute script.py C
python script.py D
compile script.py
Analysis & Theory
To execute a Python script from the terminal, use: python script.py
Which of the following Python versions first introduced f-strings?
A
2.7 B
3.5 C
3.6 D
3.7
Analysis & Theory
F-strings were introduced in Python 3.6 to make string formatting easier and more readable.