MCQs
1. Python is known for its:
(A) Complex syntax (B) Simple syntax
(C) Slow execution (D) Limited libraries
2. Which feature makes Python ideal for beginners?
(A) Complex syntax (B) English-like readability
(C) Slow execution speed (D) Limited community support
3. What is the main function used to display output in Python?
(A) echo (B) show (C) print() (D) write()
4. What will the following code display?
x = 10
print(f"Value: {x}")
(A) Value: x (B) Value: {x} (C) Value: 10 (D) Syntax error
5. An action needed during Python installation to run from the command line easily:
(A) Uncheck "Add Python to PATH" (B) Choose a different IDE
(C) Check "Add Python to PATH" (D) Install only the IDE
6. Output of following piece of code is:
age = 25
print("Age :", age)
(A) Age: 25 (B) 25 (C) Age (D) age
7. Which tool would you use to debug errors in a Python script?
(A) IDLE Debugger (B) Python Compiler
(C) Command Prompt (D) Web Browser
8. Who developed Python?
(A) Bill Gates (B) Guido van Rossum
(C) Mark Zuckerberg (D) Linus Torvalds
9. Prototyping in Python means:
(A) Writing final production code (B) Creating an early version to test ideas
(C) Debugging complex programs (D) Compiling code to machine language
10. The main advantage of Python being cross-platform is:
(A) High speed (B) Code can run on any OS
(C) It is an old language (D) None of the above
11. Which menu option in IDLE is used to create a new script file?
(A) File → Open (B) File → New File (C) Edit → Copy (D) Run → Run Module
12. Which function in Python allows the user to provide input:
(A) scan() (B) get() (C) input() (D) ask()
13. The input() function return ______ by default:
(A) Integer (B) Float (C) String (D) Boolean
14. ______ symbol is used to start a string in the print() function:
(A) Quotation marks (" ") (B) Colon (:) (C) Parentheses () (D) Comma (,)
15. The function used to take input from users is:
(A) print() (B) scan() (C) input() (D) get()
16. Which Python function helps receive data during a program’s execution:
(A) output() (B) get() (C) input() (D) fetch()
17. The print() function use to ______ in Python:
(A) Takes input (B) Displays output
(C) Declares variables (D) Executes a loop
18. Why is data from input() often converted using int() or float():
(A) To add it to text (B) To perform mathematical operations
(C) To make it lowercase (D) To split into words
19. How does the f-string improve the output process in Python:
(A) It makes input easier (B) It skips the print step
(C) It mixes variables with text clearly (D) It runs code faster
20. In Python programs, what is the main purpose of input() and print() together:
(A) To create random values (B) To connect different files
(C) To take user input and show results (D) To write into a file
Short Questions
1. What is the primary purpose of the print() function in Python?
The print() function displays output to the user, showing results or messages on the screen. It can
output text, variables, or combinations of both in various formats.
2. Why must numeric input from users be converted before calculations?
Python’s input() always returns string values, even for numbers. Conversion with int() or float() is
needed because mathematical operations require numeric data types.
3. Name two programming paradigms that Python supports.
Python supports both procedural programming (writing code as procedures/routines) and object-
oriented programming (organizing code into classes and objects).
4. What are the two modes for writing Python programs in IDLE?
Python programs can be written in either interactive mode (direct execution at the prompt) or script
mode (saving code in .py files for later execution).
5. A beginner wants to test a simple print statement. Which IDLE mode would you recommend and
why?
Interactive mode would be best as it allows immediate execution of single commands like
print("Hello"). This provides instant feedback without needing to create/save a file.
6. Who developed Python and when was it first released?
Python was developed by Guido van Rossum and first released in 1991. It was designed to be a high-
level, general-purpose programming language with simple syntax.
7. Which key combination is used to save a Python script in IDLE?
The Ctrl+S key combination is used to save a Python script in IDLE. This saves the code with a .py
extension for later execution.
8. Describe the steps to create and run a Python script that calculates the average of three numbers.
Open IDLE and create a new file (Ctrl+N)
Write code:
num1=10; num2=20; num3=30
avg=(num1+num2+num3)/3
print("Average:", avg)
Save as [Link] (Ctrl+S)
Run with F5 to see output
9. A programmer gets a syntax error when running their script. What should they check first?
First check for red underlined text in IDLE indicating syntax errors. Common issues include missing
colons after statements, incorrect indentation, or mismatched parentheses/quotations. The error
message will specify the line number.
10. What makes Python an ideal language for beginners?
Python’s simple syntax resembles plain English, making it easy to learn and write. Its clean structure
and lack of complicated rules enable beginners to focus on learning programming concepts instead of
complex syntax.
11. Why is cross-platform compatibility important in Python?
Cross-platform compatibility allows Python programs to run on different operating systems like
Windows, macOS, and Linux without modification. This makes Python versatile and suitable for
various development environments.
12. Why is Python considered a high-level programming language?
Python is high-level because it abstracts complex hardware-level operations, allowing developers to
write human-readable code. It simplifies tasks like memory management and offers features like
dynamic typing and built-in data structures.
13. What is IDLE, and why is it essential for Python programming?
IDLE (Integrated Development and Learning Environment) is a user-friendly interface for writing and
testing Python code. It includes tools like a code editor, interactive shell, and debugger, simplifying
code development and execution.
14. Describe the steps to set up Python on a computer.
To set up Python, download the latest version from [Link] and run the installer. Check the “Add
Python to PATH” option during installation for command-line execution. Once installed, use IDLE or
any IDE to write and execute Python code.
15. A weather program needs to display "Current temp: X°C". Which print() method would be most
suitable and why?
An f-string would be ideal because it cleanly incorporates the temperature variable within the output
message, making the code easy to read and maintain.
16. What is the key difference between input() with and without a prompt string?
input() with a prompt displays a message telling users what to enter, while input() without a prompt
shows a blank line. The prompt makes programs more user-friendly.
17. What makes f-strings different from other string formatting methods?
F-strings allow direct variable insertion within curly braces inside the string itself, making formatting
more readable and concise compared to older methods.
18. Describe how a shopping program could use input() and print() together effectively.
The program could use input() to ask for item names and quantities, then print() to display a
formatted receipt with prices and totals, creating a complete user interface.
19. What problems might occur if a program uses input() without clear prompts?
Users wouldn’t know what information to enter or when, leading to incorrect inputs and program
errors. Clear prompts guide users and prevent confusion during data entry.
20. Explain how print() formatting affects user experience in professional programs.
Proper print() formatting creates clean, organized output that’s easy to understand. Well-formatted
displays appear more professional and make programs more user-friendly.
21. Find the errors in the following statement:
print("Hello)
Error: Missing closing quotation mark.
22. Find the errors in the following statement:
print("Result:", a)
Error: NameError, because variable a is not defined.
23. Find the errors in the following statements:
x=5
y=
print(x + y)
Error: Syntax error due to incomplete assignment of y.