Simple Banking System

print("Welcome to the Simple Banking System!\n")

balance = 100.0
choice = 0

while choice != 4:
    print("Menu:")
    print("1. Check Balance")
    print("2. Deposit Money")
    print("3. Withdraw Money")
    print("4. Exit")

    choice = int(input("Enter your choice (1/2/3/4): "))

    if choice == 1:
        print("Your current balance is: $", balance)
    elif choice == 2:
        print("Enter amount to deposit: $", end="")
        amount = float(input())
        balance = balance + amount
        print("Deposited $", amount)
        print("New balance is: $", balance)
    elif choice == 3:
        print("Enter amount to withdraw: $", end="")
        amount = float(input())
        balance = balance - amount
        print("Withdrew $", amount)
        print("New balance is: $", balance)
    elif choice == 4:
        print("Thank you for using the Simple Banking System. Goodbye!")
    else:
        print("Invalid choice. Please try again.")
    print()

---------------------------------------------------------------------------------------

Temperature Converter

print("Temperature Converter")
print("Choose conversion type:")
print("1. Celsius to Fahrenheit")
print("2. Fahrenheit to Celsius")

conversion = int(input("Enter your choice (1/2): "))

if conversion == 1:
    print("Enter temperature in Celsius: ", end="")
    celsius = float(input())
    fahrenheit = (celsius * 9 / 5) + 32
    print(celsius, "°C is equal to", fahrenheit, "°F.")
elif conversion == 2:
    print("Enter temperature in Fahrenheit: ", end="")
    fahrenheit = float(input())
    celsius = (fahrenheit - 32) * 5 / 9
    print(fahrenheit, "°F is equal to", celsius, "°C.")
else:
    print("Invalid choice.")

--------------------------------------------------------------------------------

Guess the Number Game (between 1 and 10)

print("Welcome to the Guess the Number Game!")
print("I have chosen a number between 1 and 10. Can you guess it?")

number_to_guess = 7  # Hardcoded for consistent output
guessed = False
attempts = 0

while not guessed:
    print("Enter your guess: ", end="")
    guess = int(input())
    attempts = attempts + 1

    if guess < number_to_guess:
        print("Too low. Try again!")
    elif guess > number_to_guess:
        print("Too high. Try again!")
    else:
        guessed = True
        print("Congratulations! You guessed it in", attempts, "attempts.")


--------------------------------------------------------------------------------

Multiplication Table

# Multiplication Table Program

print("Enter an integer to generate its multiplication table:", end=" ")
num = int(input())

print("Multiplication Table for", num)

i = 1
while i <= 10:
    print(num, "x", i, "=", num * i)
    i = i + 1


------------------------------------------------------------------------------

Simple Calculator

# Simple Calculator Program

print("Welcome to the Simple Calculator!")

print("Enter the first number:", end=" ")
a = input()
a = float(a)

print("Enter the second number:", end=" ")
b = input()
b = float(b)

print("Select an operation:")
print("1. Addition (+)")
print("2. Subtraction (-)")
print("3. Multiplication (*)")
print("4. Division (/)")

print("Enter your choice (1/2/3/4):", end=" ")
choice = input()

if choice == "1":
    result = a + b
elif choice == "2":
    result = a - b
elif choice == "3":
    result = a * b
elif choice == "4":
    result = a / b
else:
    result = "Invalid choice"

print("Result:", result)
-----------------------------------------------------------------------------





