Tense Passage Exercise – 1
If Else Programs Advanced
1. Electricity Bill Calculator
units = int(input(“Enter electricity units consumed: “))
if units <= 100:
amount = units * 5
elif units <= 200:
amount = 100 * 5 + (units – 100) * 7
elif units <= 300:
amount = 100 * 5 + 100 * 7 + (units – 200) * 10
else:
amount = 100 * 5 + 100 * 7 + 100 * 10 + (units – 300) * 15
print(“Total electricity bill: ₹”, amount)
2. ATM Withdrawal Logic
balance = 10000
amount = int(input(“Enter amount to withdraw: “))
if amount % 100 != 0:
print(“Please enter amount in multiples of 100.”)
elif amount > balance:
print(“Insufficient balance.”)
elif amount > 5000:
print(“Maximum withdrawal limit is ₹5000 at a time.”)
else:
balance -= amount
print(f”Please collect your cash. Remaining balance: ₹{balance}”)
3. Movie Ticket Pricing Based on Age and Time
age = int(input(“Enter your age: “))
time = int(input(“Enter time in 24-hr format (e.g., 13 for 1 PM): “))
if age < 5:
price = 0
elif age <= 18:
price = 100
elif age >= 60:
price = 80
else:
price = 150
# Add time-based discount
if 11 <= time <= 14:
price -= 20 # Matinee discount
print(“Your ticket price is: ₹”, price)
4. Traffic Fine Calculator
speed = int(input(“Enter vehicle speed (in km/h): “))
is_school_zone = input(“Is this a school zone? (yes/no): “).lower()
if speed <= 40:
print(“No fine.”)
elif speed <= 60:
fine = 100
elif speed <= 80:
fine = 300
else:
fine = 1000
if is_school_zone == “yes”:
fine *= 2
print(“Your fine is: ₹”, fine)
5. Three-Subject Result System
sub1 = int(input(“Enter marks of Subject 1: “))
sub2 = int(input(“Enter marks of Subject 2: “))
sub3 = int(input(“Enter marks of Subject 3: “))
if sub1 < 33 or sub2 < 33 or sub3 < 33:
print(“Result: Fail (one or more subjects below pass marks)”)
else:
avg = (sub1 + sub2 + sub3) / 3
if avg >= 75:
print(“Result: Distinction”)
elif avg >= 60:
print(“Result: First Division”)
elif avg >= 45:
print(“Result: Second Division”)
else:
print(“Result: Third Division”)
Class 9 Motion Notes
Class – 9 CBSE
Chapter – Motion
Class 9 Physics Chapter 1 notes
- Motion:
An object is said to be in motion if it changes its position with respect to its surroundings.
Example: A car moving on the road or a fan rotating. - Rest:
A body is at rest if it does not change its position with respect to its surroundings.
Example: A book lying on a table. - Displacement:
The shortest distance between the initial and final positions of an object.
SI Unit: metre (m)
Example: If you walk from your home to a friend’s house in a straight line, that’s displacement.
- Vector:
Physical quantities having both magnitude and direction.
Example: Velocity, force. - Scalar:
Physical quantities having only magnitude and no direction.
Example: Speed, distance, time.
- Uniform Motion:
A body covers equal distances in equal intervals of time.
Example: A car moving at a constant speed of 60 km/h on a highway. - Non-uniform Motion:
A body covers unequal distances in equal time intervals or equal distances in unequal time intervals.
Example: A car stuck in traffic keeps changing speed.
- Speed:
Speed = Distance / Time
SI Unit: m/s
Example: A train covers 300 km in 3 hours, so speed = 100 km/h. - Average Speed:
Average Speed = Total Distance Travelled / Total Time Taken - Locomotion:
Movement of animals from one place to another.
Example: A dog running, a bird flying. - Velocity:
The displacement covered per unit time in a given direction.
Velocity = Displacement / Time
SI Unit = m/s - Uniform Velocity:
Equal displacement in equal intervals of time in a particular direction. - Variable Velocity:
Displacement changes in unequal intervals of time or direction keeps changing.
Example: A bus moving in a city street with turns and stops. - Acceleration:
Rate of change of velocity.
Acceleration = (Final Velocity – Initial Velocity) / Time
SI Unit = m/s² - Retardation or Deceleration:
Negative acceleration; when the velocity of an object decreases.
Example: A bicycle slowing down before stopping. - Uniform Acceleration:
Velocity changes by equal amounts in equal intervals of time.
Example: Free fall under gravity. - Variable Acceleration:
Velocity changes by unequal amounts in equal time intervals.
Example: A car speeding up irregularly in traffic.
Equations of Motion (For Uniform Acceleration)
- v = u + at
- s = ut + ½ at²
- v² = u² + 2as
Where:
- s = Distance
- u = Initial velocity
- v = Final velocity
- a = Acceleration
- t = Time
Graphs
- Distance-Time Graph:
-
- Shows time vs distance.
- Slope = Speed
Example: A straight line shows uniform speed.
- Velocity-Time Graph:
-
- Shows time vs velocity.
- Slope = Acceleration
- Area under the graph = Distance covered
Circular Motion Concepts
- Uniform Circular Motion:
When a body moves in a circular path with uniform speed.
Example: A satellite orbiting the Earth. - Angular Displacement:
Angle swept by the radius of a circular path in a given time. - Angular Velocity (ω):
Angular Velocity = Angle swept / Time = θ / t
Units: rad/s - Time Period (T):
Time taken to complete one full revolution. - Frequency (f):
Number of revolutions per unit time.
f = 1 / T
Relation Between Linear and Circular Motion
- Linear Velocity (v):
v = 2πr / T = rω - Relation Between Linear Velocity and Time Period:
v = Circumference / Time period
Notations of Physical Quantities
Quantity | Symbol |
Distance | s |
Speed | v |
Time | t |
Acceleration | a |
Initial Velocity | u |
Final Velocity | v |
Average Velocity | v̅ |
Useful Formulas and Equations
- v = u + at
- s = ut + ½ at²
- v² = u² + 2as
- Average Velocity (v̅) = (u + v) / 2
- s = v̅ × t = [(u + v)/2] × t
.
National Income MCQs
Python If Else Examples
Python
Conditional Statements ( If – Else )
- Check whether the number is positive or negative
num = int(input(“Enter a number: “))
if num >= 0:
print(“The number is positive”)
else:
print(“The number is negative”)
- Check Whether the number is Odd or Even
num = int(input(“Enter a number: “))
if num % 2 == 0:
print(“Even number”)
else:
print(“Odd number”)
- Check if a person is eligible to vote
age = int(input(“Enter your age: “))
if age >= 18:
print(“You are eligible to vote”)
else:
print(“You are not eligible to vote”)
- Find the greatest of two numbers
a = int(input(“Enter first number: “))
b = int(input(“Enter second number: “))
if a > b:
print(“First number is greater”)
else:
print(“Second number is greater or equal”)
- Check if a number is divisible by 5
num = int(input(“Enter a number: “))
if num % 5 == 0:
print(“The number is divisible by 5”)
else:
print(“The number is not divisible by 5”)
- Check whether a year is a leap year
year = int(input(“Enter a year: “))
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
print(“Leap year”)
else:
print(“Not a leap year”)
- Check if a character is a vowel or consonant
ch = input(“Enter a character: “).lower()
if ch in ‘aeiou’:
print(“Vowel”)
else:
print(“Consonant”)
- Simple grading system
marks = int(input(“Enter marks: “))
if marks >= 90:
print(“Grade A”)
elif marks >= 75:
print(“Grade B”)
elif marks >= 50:
print(“Grade C”)
else:
print(“Grade D”)
- Check if a triangle is valid
a = int(input(“Enter first side: “))
b = int(input(“Enter second side: “))
c = int(input(“Enter third side: “))
if a + b > c and b + c > a and c + a > b:
print(“Valid triangle”)
else:
print(“Invalid triangle”)
- Check whether the entered character is uppercase or lowercase
ch = input(“Enter a character: “)
if ch.isupper():
print(“Uppercase letter”)
elif ch.islower():
print(“Lowercase letter”)
else:
print(“Not an alphabet letter”)