Python Questions
Python Questions
8. Define control flow statements. Explain if, if...else, and if...elif...else with syntax and examples.
10. What is the difference between break and continue statements? Give examples.
11. Write a Python program to check if a number is even or odd using if-else.
12. Write a program to print the sum of the first 10 even numbers.
13. Write a Python program to input a number and find its factorial.
print(x)
2. Differentiate between mutable and immutable data types using strings and lists.
Page 1|3
7. What is a list in Python? How is it different from arrays?
10. Write a Python program to input 5 numbers into a list and find their sum.
11. Write a program using zip() to combine two lists into a dictionary.
Page 2|3
9. What are regular expressions? Explain with examples.
10. Write a program to extract email addresses from a text using regular expressions.
10. Create a class Student and input name and marks, then print details using a method.
Page 3|3