Python 10mark Revision Complete
Python 10mark Revision Complete
This sheet contains 15 handpicked, high-weightage 10-mark questions covering Units II to V. Each question
---
Example:
x = 10
if x > 5:
print("Greater")
Example:
n=3
if n > 0:
print("Positive")
elif n == 0:
print("Zero")
else:
print("Negative")
Example:
for i in range(3):
print(i)
Example:
for i in range(5):
if i == 2: continue
print(i)
Example:
x = 10
y = 20
---
Example:
def greet():
print("Hello")
return a + b
7. Discuss parameter passing: actual vs formal, mutable vs immutable.
Example:
def func():
a = 10 # local
x = 5 # global
Example:
print(len([1,2,3]))
Example:
def factorial(n):
if n == 1:
return 1
return n * factorial(n-1)
---
Example:
class Car:
self.model = model
12. Write about Turtle graphics and attributes.
Example:
import turtle
t = turtle.Turtle()
t.forward(100)
t.right(90)
- import module_name
Example:
import math
print(math.sqrt(16))
---
Example:
class Animal:
def sound(self):
print("Animal sound")
class Dog(Animal):
def sound(self):
print("Bark")
---
Tip: These 15 questions are commonly repeated in university exams. Mastering them will help you handle