some new things, mostly not working or finished

This commit is contained in:
2025-11-08 18:16:10 +01:00
parent 5792bfbd9a
commit 795fb42900
30 changed files with 4789 additions and 1 deletions

31
functions/umrechner.py Normal file
View File

@@ -0,0 +1,31 @@
def euroToDollar(euro_amount, kurs=1.15):
return euro_amount * kurs
def dollarToEuro(dollar_amount, kurs=1.15):
return dollar_amount / kurs
def main():
print("WährungsUmrechner ")
print("Aktueller Kurs: 1€ = {:.2f}USD".format(1.15))
richtung = input("1) € auf $ \n 2) $ auf € \nIhre Wahl: ")
if richtung == "1":
euro_str = input("€: ")
try:
euro = float(euro_str.replace(",","."))
dollar = euroToDollar(euro, kurs=1.15)
print(f"{euro:.2f}€ entsprechen {dollar:.2f}$")
except ValueError as e:
print(e)
elif richtung == "2":
usd_str = input("$: ")
try:
usd = float(usd_str.replace(",","."))
euro = dollarToEuro(usd, kurs=1.15)
print(f"{usd:.2f}$ entsprechen {euro:.2f}")
except ValueError as e:
print(e)
else:
print("wähle richtig")
if __name__ == "__main__":
main()