1. What does HTTP stand for?
A. HyperText Transmission Protocol
B. Hyper Transfer Text Protocol
C. HyperText Transport Protocol
D. HyperText Markup Protocol
Answer: A
Rationale: HTTP stands for HyperText Transfer Protocol, used for transferring
web pages on the internet.
2. What is the purpose of the return statement in a function?
A. To stop the function
B. To execute the next statement
C. To return a value from the function
D. To declare a variable
Answer: C
,Rationale: The return statement is used to send a value back from a function to the
caller.
3. Which of the following is a feature of Object-Oriented Programming?
A. Functions
B. Inheritance
C. Loops
D. Arrays
Answer: B
Rationale: Inheritance is one of the key features of OOP, allowing one class to
inherit properties and methods from another.
4. What type of error is raised when Python encounters a syntax mistake?
A. Runtime Error
B. Logic Error
C. Syntax Error
D. Name Error
Answer: C
, Rationale: A Syntax Error occurs when Python encounters code that doesn't
conform to the syntax rules.
5. What is the output of the following code in Python?
python
Copy
print(9 // 4)
A. 2
B. 2.25
C. 3
D. 4
Answer: A
Rationale: The // operator performs floor division, which returns the quotient
without the decimal part.
6. Which of the following is the correct syntax to define a class in Python?
A. class MyClass()
B. class MyClass:
A. HyperText Transmission Protocol
B. Hyper Transfer Text Protocol
C. HyperText Transport Protocol
D. HyperText Markup Protocol
Answer: A
Rationale: HTTP stands for HyperText Transfer Protocol, used for transferring
web pages on the internet.
2. What is the purpose of the return statement in a function?
A. To stop the function
B. To execute the next statement
C. To return a value from the function
D. To declare a variable
Answer: C
,Rationale: The return statement is used to send a value back from a function to the
caller.
3. Which of the following is a feature of Object-Oriented Programming?
A. Functions
B. Inheritance
C. Loops
D. Arrays
Answer: B
Rationale: Inheritance is one of the key features of OOP, allowing one class to
inherit properties and methods from another.
4. What type of error is raised when Python encounters a syntax mistake?
A. Runtime Error
B. Logic Error
C. Syntax Error
D. Name Error
Answer: C
, Rationale: A Syntax Error occurs when Python encounters code that doesn't
conform to the syntax rules.
5. What is the output of the following code in Python?
python
Copy
print(9 // 4)
A. 2
B. 2.25
C. 3
D. 4
Answer: A
Rationale: The // operator performs floor division, which returns the quotient
without the decimal part.
6. Which of the following is the correct syntax to define a class in Python?
A. class MyClass()
B. class MyClass: