💰 Build a Simple Payment App in Python (OOP Project)
Short Description: Learn how to build a simple Payment App in Python using OOP. Send, add, and check balance in this beginner-friendly console project.
🧩 Introduction
Welcome to another 6-Minute Python Project from DomeBytes!
In this tutorial, you’ll learn how to create a simple payment application using Object-Oriented Programming (OOP) in Python.
This beginner-friendly project helps you understand classes, methods, and real-world coding logic through a fun console-based banking system.
🧠 What You’ll Learn
- Using classes and objects in Python
- Building an interactive text-based menu
- Managing user balances with methods like
add_money()
,send_money()
, andshow_balance()
🧾 Full Python Code
print("💰 Welcome to PythonPay - Simple Payment App 💰")
class User:
def __init__(self, name, balance=0):
self.name = name
self.balance = balance
def show_balance(self):
print(f"\n💳 {self.name}'s Balance: ₹{self.balance}")
def add_money(self, amount):
if amount > 0:
self.balance += amount
print(f"✅ ₹{amount} added successfully!")
else:
print("❌ Invalid amount!")
def send_money(self, receiver, amount):
if amount <= 0:
print("❌ Invalid amount!")
elif self.balance < amount:
print("⚠️ Insufficient balance!")
else:
self.balance -= amount
receiver.balance += amount
print(f"✅ Sent ₹{amount} to {receiver.name}")
user1 = User("Amal", 500)
user2 = User("Rahul", 300)
def menu():
print("\n1️⃣ Show Balance\n2️⃣ Add Money\n3️⃣ Send Money\n4️⃣ Exit")
while True:
menu()
choice = input("Select an option: ")
if choice == '1':
user1.show_balance()
elif choice == '2':
amt = int(input("Enter amount to add: ₹"))
user1.add_money(amt)
elif choice == '3':
amt = int(input(f"Enter amount to send to {user2.name}: ₹"))
user1.send_money(user2, amt)
elif choice == '4':
print("👋 Thank you for using PythonPay!")
break
else:
print("❌ Invalid option, try again!")
⚙️ How It Works
- Create two users (Amal and Rahul) with starting balances.
- Use a menu system to perform actions:
- Check your balance
- Add money
- Send money to another user
- OOP methods handle all transactions cleanly with printed confirmations.
🎥 Watch Tutorial
Watch the full 2-minute Python tutorial below 👇
❓ FAQ
Q1: Can I add more users?
✅ Yes! Just create more objects like user3 = User("Anu", 1000)
.
Q2: Does it work in mobile IDEs (like Pydroid3)?
✅ Absolutely — this is a text-based console project and runs perfectly.
Q3: How to restart after Exit?
🔁 Just rerun the Python file in your IDE or terminal.
📢 Tags / SEO Keywords
python payment app, oop python project, python mini project, 2 minute python coding, domebytes, python console app, python for beginners, python practice project
🔗 Promote
📖 Read more awesome Python projects at www.domebytes.com
🎥 Subscribe on YouTube: An-Diaries (DomeBytes Projects)