Skip to content
Zeni Study
  • Pages
    • Learn Python In 7 Days
      • Day 1 : Variable + if/else
      • Day 2: Loops
      • Day 3 : Array + String
      • Day 4 — Functions
      • Day 5 — Dictionaries - Hashmap
      • Day 6 — Files & Errors
      • Day 7 — Mini Project & Programmer Thinking
    • Machine Coding:
      • Day 1 — Bank account + Wallet :
      • Day 2 : RateLimiter + seat booking
      • Day 3 : Library Management + Classroom Attendance System
      • Day 4 : Bank account and notification system.
      • Day 5 : Key-value and payment processor.
      • Day 6 : Discount engine + Seat booking( in depth)
      • Day 7: Parking lot System :
    • Machine coding extended:
      • Day 7.5 — Parking Lot (Constraint-Heavy Variant)
      • Day 8 : Order + Payment System
      • Day 8 — Extension Round (Mid-Interview Change)
      • Day 9 — Ticket Booking with Expiry (Simulated Time)
      • Day 9 — Extension Round (Seat Lock Ownership + Forced Unlock)
    • SQL + DB Thinking course
      • Day 1 — Tables, Rows & Thinking in Data
      • Day 2 — Relationships & Foreign Keys (Thinking in Connections)
      • Day 3 — Filtering, Aggregation & Answering Data Questions
      • Day 4 — JOINs (Combining Tables the Right Way)
      • Day 5 — Subqueries, EXISTS & NOT EXISTS (Thinking in Layers)
      • Day 6 — Indexes, Constraints & How Databases Think
      • Day 7 — Full SQL Interview Simulation (SDE-1 Ready)
      • Extended Day 1 — Core Business Systems (Deep Practice)
      • Extended Day 2 — Booking & Platform Systems (High-Depth Practice)
      • Extended Day 3 — Content & Learning Platforms (Capstone Practice)
    • LLD: Java
      • DAY 1 — Core Foundations (SDE-2 Level)
      • DAY 2 — State, Time & Domain Correctness
      • DAY 3 — Extensibility & Failure Handling (SDE-2 Core Signal)
      • DAY 4 — Concurrency, Scheduling & Consistency (SDE-2 Critical)
      • DAY 5 — Workflow Design & Config-Driven Systems (SDE-2+)
      • DAY 6 — Eventing & Usage-Based Systems (Advanced SDE-2)
      • DAY 7 — Interview Simulation (Hard, Production-Grade)
      • Hidden Edge Cases Interviewers Expect (Day-wise)
      • Detailed Testing file:
    • Assignment:
      • icon picker
        If else Practice Set

If else Practice Set

1️⃣ Ticket Price Calculator

Problem Take age as input and print ticket price:
Age < 5 → Free
Age between 5 and 18 → 50
Age between 19 and 60 → 100
Age > 60 → 70

2️⃣ Leap Year Checker

Problem Take a year as input and check:
If divisible by 400 → Leap Year
Else if divisible by 100 → Not a Leap Year
Else if divisible by 4 → Leap Year
Else → Not a Leap Year

3️⃣ Triangle Type Checker

Problem Take three sides of a triangle.
If all sides equal → Equilateral
If exactly two sides equal → Isosceles
If all sides different → Scalene
📌 Assume valid triangle input.

4️⃣ Login Validation

Problem Take:
username
password
Rules:
Correct username = admin
Correct password = 1234
Print:
Login Successful
Wrong Password
Invalid Username

5️⃣ Electricity Bill Calculator

Problem Take units consumed.
Units ≤ 100 → Bill = 0
101–200 → Bill = 5 * (units - 100)
200 → Bill = 5 * 100 + 10 * (units - 200)
Print the bill amount.

6️⃣ Grade With Pass/Fail Status

Problem Take marks (0–100).
If marks < 40 → Fail
Else:
≥ 90 → A
≥ 75 → B
≥ 60 → C
Else → D

7️⃣ Number Nature Checker

Problem Take a number and print all that apply:
Positive or Negative
Even or Odd
📌 Example Output:
Positive Even

8️⃣ Simple ATM Withdrawal

Problem Take:
account balance
withdrawal amount
Rules:
Withdrawal must be a multiple of 100
Balance must be sufficient
Print:
Withdrawal Successful
Invalid Amount
Insufficient Balance

9️⃣ Time-Based Greeting

Problem Take hour (0–23).
5–11 → Good Morning
12–16 → Good Afternoon
17–20 → Good Evening
Else → Good Night

🔟 Bonus Logic Builder: Smallest of Three

Problem Take three numbers and print the smallest one.
📌 Constraint:
Use only if–elif–else
No built-in functions like min()


 
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.