Module-I
Two Marks
1. Define a program.
2. What is debugging?
3. Mention any two data types in Python.
4. What is a syntax error?
5. What is meant by a runtime error?
6. Define a semantic error.
7. What is a variable? Give an example.
8. Write any two rules for naming variables.
9. What is an expression?
10. Write a Python statement to get input from the user.
11. What is the use of the modulus operator (%)?
12. Write the output of:
print("Hi" * 3)
13. Write a Python program to print numbers from 1 to 3 using a for loop.
14. Write a Python statement to convert a string to integer.
15. Write a Python statement to update a variable.
16. Why is indentation important in Python?
Four Marks:
1. Explain syntax errors, runtime errors, and semantic errors with suitable
examples.
2. Explain values, data types, and variables in Python with examples.
3. Write a Python program to print even numbers from 1 to 10 using a for loop.
4. Write a Python program using a while loop to display numbers from 1 to 10.
5. Write a Python program to find the remainder using the modulus operator.
6. Write a Python program to generate the Collatz (3n + 1) sequence.
7. Trace the output of the following program:
x=4
while x > 0:
print(x)
x -= 1
8. Write a Python program to display a multiplication table.
9. Explain break and continue statements with examples.
10. Write a Python function with arguments and return value to find the sum of two
numbers.
11. Explain local variables and global variables in Python with suitable examples.
12. Differentiate between local variables and global variables with at least two points
and examples.
13. Evaluate the following expressions by applying precedence rules:
a) 10 + 6 * 2
b) (10 + 6) * 2
c) 20 / 5 + 3 ** 2
Module-II
Division A – Two Marks Questions
Strings
1. Define a string in Python.
2. How do you find the length of a string?
3. What is meant by string traversal?
4. Write a Python statement to access the first character of a string.
5. What is string slicing?
6. Why are strings immutable?
7. What is the use of in and not in operators with strings?
8. Write the syntax of the find () method.
9. What is the purpose of the split () method?
10. Write a Python statement using the string format method.
Tuples
11. What is a tuple?
12. How are tuples used for grouping data?
13. What is meant by tuple assignment?
14. Can a function return a tuple? Justify.
15. Write an example of a tuple.
Lists
16. What is a list in Python?
17. How do you access elements of a list?
18. What is meant by list slicing?
19. Why are lists mutable?
20. What is list membership?
21. What is aliasing in lists?
22. Write a Python statement to delete an element from a list.
23. What is meant by a nested list?
24. Write a Python statement using range() with a list.
25. Mention any two list methods.
Division B – Four Marks Questions
Strings
1. Explain working with strings as single things and parts of strings with examples.
2. Write a Python program to traverse a string using a for loop.
3. Explain string slicing and string comparison with examples.
4. Write a Python program to demonstrate the find () method.
5. Write a Python program to count the occurrence of a character in a string.
6. Explain cleaning up strings with a suitable Python program.
7. Write a Python program using the split () method.
8. Explain the string format method with an example.
Tuples
9. Explain tuples as return values with an example.
10. Write a Python program to demonstrate tuple assignment.
11. Explain the composability of data structures using tuples and lists.
Lists
12. Explain list operations, list slicing, and list membership with examples.
13. Write a Python program to show that lists are mutable.
14. Explain objects and references in lists with an example.
15. What is aliasing? Explain with a Python program.
16. Write a Python program to clone a list.
17. Write a Python program using a for loop to traverse a list.
18. Explain pure functions and modifiers with respect to lists.
19. Write a Python program that produces a list as output.
20. Explain the relationship between strings and lists with examples.
21. Write a Python program to work with a nested list (matrix).
22. Write a Python program to add two matrices using nested lists.