🧠 Python Programming – Revision
Questions (Week 1,2 & 3 Topics)
Topics Covered: Introduction to Programming, Introduction to Python, Basic Syntax,
Variables and Data Types, Input Function
🧩 Section A: Short Answer Questions
1. What is programming?
2. What is a program?
3. Name three real-life applications that use programming.
4. Why is Python considered beginner-friendly?
5. Mention three areas where Python is commonly used.
6. What is the difference between compiled and interpreted languages?
7. What does an IDE do? Give two examples of IDEs used for Python.
8. Explain the purpose of indentation in Python.
9. What is a variable?
10. What are data types in programming?
11. List five main data types in Python.
12. What symbol is used for assignment in Python?
13. What is the difference between a string and an integer?
14. What is the output of the following code?
print('Python' + 'Programming')
15. How do you take input from a user in Python?
16. What function is used to display information on the screen?
17. What does the type() function do in Python?
18. What is type casting? Give one example.
19. Write the syntax to convert a string to an integer.
20. What will be the output of the following code?
x = 10
y=2
print(x / y)
🧮 Section B: Multiple-Choice Questions (MCQs)
21. Python files usually have which extension?
a) .java b) .py c) .txt d) .exe
22. Which of these is a valid variable name?
a) 1name b) first-name c) name1 d) first name
23. Which function displays output to the screen?
a) write() b) echo() c) print() d) display()
24. What is the output of this code?
print(3 + 4 * 2)
a) 14 b) 11 c) 10 d) 8
25. What type of error will this cause?
print('Hello)
a) SyntaxError b) NameError c) TypeError d) RuntimeError
26. Which of the following is NOT a Python data type?
a) float b) real c) bool d) str
27. What will this code print?
age = 20
print('You are ' + str(age) + ' years old')
a) You are 20 years old b) Error c) You are + age + years old d) str(age)
28. What does the following code do?
num = int(input('Enter a number: ')
a) Prints a number b) Reads input as text c) Reads input as a number d) Multiplies a
number by 10
💻 Section C: Coding Practice
29. Write a Python program that prints your name, age, and a short message about
yourself.
30. Write a Python program that asks the user to enter two numbers and prints their sum,
difference, product, and quotient.
31. Write a Python program that asks the user for their name and year of birth, then
displays: Hello [name], you are [age] years old.
32. Write a Python program that asks the user to enter their favorite food and prints: Wow!
I also like [food].
33. Write a Python program that shows the data type of each variable below:
name = 'John'
age = 21
height = 1.75
is_student = True
🏁 Bonus Challenge
Write a Python program that:
1. Asks the user for their name and age.
2. Calculates how old they will be 10 years from now.
3. Prints a message like: Hi [name], in 10 years you will be [future_age] years old!