-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBankkonto_2.py
More file actions
executable file
·42 lines (34 loc) · 888 Bytes
/
Bankkonto_2.py
File metadata and controls
executable file
·42 lines (34 loc) · 888 Bytes
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
##############################################
#
# Name: Bankkonto_2.py
#
# Author: Peter Christen
#
# Version: 1.1
#
# Date: 22.05.2020
# 05.05.2022 V1.1 Zeitanpassung
#
# Purpose: Kontoverwaltung
# Kontostand erfassen
#
##############################################
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")
#Objekt/Daten erfassen
konto1=Konto("12345-1")
konto1.kontostand_erfassen(200)
#Daten auslesen
print("Kontonummer:",konto1.kontonummer, "\nKontostand:",konto1.kontostand)