xveco 0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xveco-0.0.0/LICENSE +0 -0
- xveco-0.0.0/PKG-INFO +5 -0
- xveco-0.0.0/README.md +0 -0
- xveco-0.0.0/pyproject.toml +0 -0
- xveco-0.0.0/setup.cfg +4 -0
- xveco-0.0.0/xveco/__init__.py +1 -0
- xveco-0.0.0/xveco/core.py +27 -0
- xveco-0.0.0/xveco.egg-info/PKG-INFO +5 -0
- xveco-0.0.0/xveco.egg-info/SOURCES.txt +9 -0
- xveco-0.0.0/xveco.egg-info/dependency_links.txt +1 -0
- xveco-0.0.0/xveco.egg-info/top_level.txt +1 -0
xveco-0.0.0/LICENSE
ADDED
|
File without changes
|
xveco-0.0.0/PKG-INFO
ADDED
xveco-0.0.0/README.md
ADDED
|
File without changes
|
|
File without changes
|
xveco-0.0.0/setup.cfg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .core import Currency, Account
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
class Currency:
|
|
2
|
+
def __init__(self, name, symbol, value_to_eur, logo=None):
|
|
3
|
+
self.name = name
|
|
4
|
+
self.symbol = symbol
|
|
5
|
+
self.value_to_eur = value_to_eur
|
|
6
|
+
self.logo = logo
|
|
7
|
+
|
|
8
|
+
class Account:
|
|
9
|
+
def __init__(self, name, currency: Currency):
|
|
10
|
+
self.name = name
|
|
11
|
+
self.currency = currency
|
|
12
|
+
self.balance = 0
|
|
13
|
+
|
|
14
|
+
def deposit(self, amount):
|
|
15
|
+
self.balance += amount
|
|
16
|
+
|
|
17
|
+
def withdraw(self, amount):
|
|
18
|
+
if amount > self.balance:
|
|
19
|
+
raise ValueError("no tienes suficiente saldo")
|
|
20
|
+
self.balance -= amount
|
|
21
|
+
|
|
22
|
+
def show_balance(self):
|
|
23
|
+
logo = self.currency.logo if self.currency.logo else ""
|
|
24
|
+
print(f"{logo} {self.name}: {self.balance} {self.currency.symbol}")
|
|
25
|
+
|
|
26
|
+
def balance_in_eur(self):
|
|
27
|
+
return self.balance * self.currency.value_to_eur
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
xveco
|