Your school name
1st Year Computer Chapter 2 Test1st Year · Computer · Punjab (PTB)
Q1. Multiple choice questions (Attempt all · 10 × 1 = 10)
Which of the following is a correct way to output text in Python?
How can multiple objects be created from the same class in Python?
Which of the following statements is true about the if-else statement in Python?
What is the purpose of the import statement in Python?
In the expression 2**3*4 , which operation performed first?
Which of the following is used to define a class in Python?
What will happen if all conditions in an if-elif-else statement are false?
Which of the following methods removes an item from the list?
What symbol is used to start a multi-line comment in Python?
What happens when the condition in a while loop becomes false?
Q2. Short questions (Attempt any 6 of 8 · 6 × 2 = 12)
How do you import a module from a package in Python?
How is the modulus operator % used in Python?
What does the = = operator do in Python?
How do you access an item in a list?
What is exception handling in Python?
What do comparison operators in Python do?
How can parentheses be used in expressions?
What does the not operator do in Python?
Q3. Long questions (Attempt any 2 of 3 · 2 × 4 = 8)
Explain how list slicing works with an example.
Explain the different comparison operators in Python and provide examples of how each one works.
Describe the input and output operations in Python. How does the input( ) function work, and how can you display the entered data?