Merge remote-tracking branch 'origin/master'

This commit is contained in:
TimMcCool
2019-07-23 11:06:58 +02:00
3 changed files with 46 additions and 5 deletions
+11
View File
@@ -0,0 +1,11 @@
import Klassen as k
konstante_eins = k.Groesse(None, None, True, 1)
Formeln = [k.Formel('Kraftformel', i=k.Groesse('F', 'N', False), a=k.Groesse('m', 'kg', False),
b=k.Groesse('a', 'm/s²', False), z=k.Groesse(None, None, True, 1), y=k.Groesse(None, None, True, 1),
x=k.Groesse(None, None, True, 1)),
k.Formel('Gleichm. beschl. Bew.', i=k.Groesse('s', 'm', False), a=k.Groesse(None, None, True, 0.5),
b=('a', 'm/s^2', False), c=k.Groesse('t', 's', False), z=konstante_eins, x=konstante_eins,
y=k.Groesse(None, None, True, 2)),
]
+30
View File
@@ -0,0 +1,30 @@
class Groesse:
def __init__(self, formelsymbol, einheit, konst, wert=None):
self.formelsymbol = formelsymbol
self.einheit = einheit
self.wert = wert
self.konst = konst
class Formel:
def __init__(self, name, i, a=Groesse(None, None, True, 0), b=Groesse(None, None, True, 0),
c=Groesse(None, None, True, 0), d=Groesse(None, None, True, 0), e=Groesse(None, None, True, 0),
f=Groesse(None, None, True, 0), g=Groesse(None, None, True, 0), z=Groesse(None, None, True, 0),
y=Groesse(None, None, True, 0), x=Groesse(None, None, True, 0)):
self.a = a
self.b = b
self.c = c
self.d = d
self.e = e
self.f = f
self.g = g
self.z = z
self.y = y
self.x = x
self.name = name
self.i = i
self.liste = []
for var in [self.a, self.b, self.c]:
if var.konst is False:
self.liste.append(var)
+5 -5
View File
@@ -4,12 +4,12 @@ geheimzahl = random.randrange(32)
ratezahl = 0
while ratezahl != geheimzahl:
ratezahl = int(input("Raten Sie die geheime Zahl: "))
ratezahl = int(input("Raten Sie die geheime Zahl: "))
if ratezahl > geheimzahl:
print("Zu hoch")
if ratezahl > geheimzahl:
print("Zu hoch")
elif ratezahl < geheimzahl:
print("Zu niedrig")
elif ratezahl < geheimzahl:
print("Zu niedrig")
print("Herzlichen Glückwunsch! Die geheime Zahl war " + str(geheimzahl))