Electricity Bill Calculator
units = int(input("Enter number of units consumed: "))
bill = 50 # fixed meter charge
if units <= 100:
bill += units * 1.5
elif units <= 200:
bill += 100 * 1.5 + (units - 100) * 2.0
else:
bill += 100 * 1.5 + 100 * 2.0 + (units - 200) * 3.0
print("\n--- Electricity Bill ---")
print(f"Units Consumed: {units}")
print(f"Total Amount : Rs.{bill:.2f}")
Absolute Value Calculator
num = complex(input("Enter a number (real or complex): "))
print("Absolute value:", abs(num))
Employee Salary Slip
name = input("Enter employee name: ")
emp_id = input("Enter employee ID: ")
hours = float(input("Enter hours worked: "))
wage = float(input("Enter hourly wage: "))
gross = hours * wage
tax = gross * 0.10
net = gross - tax
print("\n--- Salary Slip ---")
print(f"Name : {name}")
print(f"ID : {emp_id}")
print(f"Gross Pay : Rs.{gross:.2f}")
print(f"Tax (10%) : Rs.{tax:.2f}")
print(f"Net Salary : Rs.{net:.2f}")
Guess a Number
import random
num = random.randint(1, 9)
guess = int(input("Guess a number between 1 and 9: "))
print("Correct!" if guess == num else f"Wrong! It was {num}")
Movie Ticket Cost with GST
category = input("Enter ticket category (Silver/Gold/Platinum): ").lower()
count = int(input("Enter number of tickets: "))
prices = {"silver": 120, "gold": 180, "platinum": 250}
base_cost = prices.get(category, 0) * count
gst = base_cost * 0.18
total = base_cost + gst
print("\n--- Movie Ticket Bill ---")
print(f"Category : {category.capitalize()}")
print(f"Tickets : {count}")
print(f"Base : Rs.{base_cost:.2f}")
print(f"GST (18%): Rs.{gst:.2f}")
print(f"Total : Rs.{total:.2f}")