-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBankkonto_3.py
More file actions
executable file
·55 lines (43 loc) · 1.22 KB
/
Bankkonto_3.py
File metadata and controls
executable file
·55 lines (43 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
##############################################
#
# Name: Bankkonto_3.py
#
# Author: Peter Christen
#
# Version: 1.1
#
# Date: 22.05.2020
# 05.05.2022 V1.1 Zeitanpassung
#
# Purpose: Kontoverwaltung
# Daten ausgeben
#
##############################################
import datetime
# Klassen
class Konto:
'''Klasse Konto zur Verwaltung von Bankkonten'''
# Konstruktor Methode
def __init__(self, ktnr):
# Attribute
self.kontonummer = ktnr
# Weitere Methode
def kontostand_erfassen(self, kontostand):
'''Initialer Kontostand erfassen'''
now = datetime.datetime.now()
self.kontostand = kontostand
self.aenderung_kontostand = now.strftime("%d.%m.%Y %H:%M:%S")
def daten_ausgeben(self):
'''Kunden- und Kontodaten ausgeben'''
print("######################")
print("# Kontoangaben ")
print("######################")
print("Kontonummer:", self.kontonummer)
print("Kontostand:", "{:.2f}".format(self.kontostand))
print("per Stichtag:", self.aenderung_kontostand)
print()
# Objekt/Daten erfassen
konto1 = Konto("12345-1")
konto1.kontostand_erfassen(200)
# Daten ausgeben
konto1.daten_ausgeben()