44 lines
1007 B
Python
44 lines
1007 B
Python
#! /usr/bin/env python3
|
|
|
|
import random
|
|
|
|
|
|
class my_rechner:
|
|
def __init__(self, zahl=0):
|
|
self.zahl = zahl
|
|
self.rechen_art = ['*', '+', '-']
|
|
self.art = random.choice(self.rechen_art)
|
|
|
|
|
|
def check_input(self):
|
|
pass
|
|
|
|
def rechnen(self):
|
|
pass
|
|
|
|
def check_rechnen(self):
|
|
self.zahl = random.randint(1, 1000)
|
|
self.art = random.choice(self.rechen_art)
|
|
|
|
def main_run(self):
|
|
|
|
while True:
|
|
print(self.zahl , self.art)
|
|
r = str(str(self.zahl) + ' ' + str(self.art) + ' '+ str(self.zahl))
|
|
summe = eval(r)
|
|
self.check_rechnen()
|
|
print(r)
|
|
print(summe)
|
|
|
|
check_input = input("Noch eine Frage ? :")
|
|
if len(check_input) == 1 and check_input == "n":
|
|
break
|
|
else:
|
|
print("false")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
print("Running Main", "." *3)
|
|
rechnen_now = my_rechner()
|
|
rechnen_now.main_run()
|