Question Bank for python
Question Bank for python
2 marks Questions
UNIT-I: INTRODUCTION
1. What is the history of Python programming language?
2. List four key features of Python.
3. Explain the purpose of quotations in Python with an example.
4. Describe the significance of indentation in Python programming.
5. Write a simple Python program to print "Hello, World!".
6. Demonstrate how to use input operations to accept a user’s name and
display it.
7. Differentiate between single-line and multi-line statements in Python.
8. Compare the use of single, double, and triple quotations in Python.
9. Assess the importance of Python’s interactive mode for beginners.
10. Design a Python program that takes two numbers as input and prints their
sum.
UNIT-II: DATA, EXPRESSIONS, STATEMENTS
11. Define the term "variable" in Python.
12. List the basic data types in Python.
13. Explain the precedence of operators in Python with an example.
14. Describe how tuple assignment works in Python.
15. Write a Python program to exchange the values of two variables.
16. Create a program to calculate the distance between two points using
coordinates.
17. Compare the use of comments and expressions in a Python program.
18. Analyze how Python’s interactive mode differs from script mode.
19. Justify the need for type conversion in Python expressions.
20. Design a program to circulate the values of three variables (e.g., a→b,
b→c, c→a).
UNIT-III: CONTROL FLOW STATEMENTS AND STRINGS
21. What is the purpose of the "break" statement in Python?
22. List three in-built string methods in Python.
23. Explain the difference between "while" and "for" loops in Python.
24. Describe how string slicing works with an example.
25. Write a Python program using an if-elif-else statement to check if a
number is positive, negative, or zero.
26. Demonstrate the use of a for loop to print the characters of a string.
27. Differentiate between the "continue" and "pass" statements with
examples.
28. Compare nested if statements and if-elif-else statements in terms of
readability.
29. Assess the effectiveness of string formatting operations in Python.
30. Design a program to reverse a string using a while loop.
3 marks Questions:
UNIT-I: INTRODUCTION
1. Outline the history of Python programming language with key
milestones.
2. List and briefly describe three features of Python that make it popular.
3. Explain how quotations (single, double, and triple) are used in Python
with examples.
4. Discuss the role of lines and indentation in structuring Python code.
5. Write a Python program that takes a user’s age as input and prints a
greeting message.
6. Demonstrate the use of multi-line statements in Python with a simple
example.
7. Differentiate between input and output operations in Python with
examples.
8. Compare the readability of code with proper indentation versus without
indentation.
9. Assess the significance of Python’s simplicity for beginner programmers.
10. Design a Python program that accepts two strings as input and
concatenates them with a space.
5 marks Questions:
UNIT-I: INTRODUCTION
1. Describe the history of Python, highlighting its origin, major versions,
and contributors.
2. Enumerate and explain five key features of Python that distinguish it
from other programming languages.
3. Explain the significance of quotations in Python and illustrate their use
with examples for single, double, and triple quotes.
4. Discuss how lines and indentation affect the execution of a Python
program, with an example.
5. Write a Python program that accepts a user’s name and age as input and
prints a formatted welcome message.
6. Demonstrate the use of multi-line statements to calculate and display the
area and perimeter of a rectangle.
7. Compare input and output operations in Python, providing examples of
each and their practical uses.
8. Differentiate between Python’s script mode and interactive mode,
analyzing their advantages in coding.
9. Assess the impact of Python’s simplicity and readability on its adoption
in educational settings.
10. Design a Python program that takes three inputs (name, city, and hobby)
and generates a personalized multi-line story.