ich bin grad daebi Python zu lernen und habe deshalb mal ein Prog erstellt, aber leider funzt es nicht. Bitte sagt mir mal was hier das Prob ist, würde mich freuen.
Danke im Voraus
MfG
J.
Code: Alles auswählen
#!/usr/bin/python
import random
random.seed()
print("Dies ist ein kleines Kopfrechenprogramm welches mit Zahln von 1 bis 1000 rechnet und Addition und Subtraktion anbietet.")
print ("Bitte gebe hier ein + für das Rechnen mit Addition und ein - für Subtraktion ein.")
x = input()
while x == "+":
a = random.randint(1.1000)
b = random.randint(1.1000)
print("Die Zahlen zum Addieren sind:". a. b)
c = a + b
if c == int(input()):
print("Das ist richtig, auf ein Neues")
continue
else:
print("Das ist leider nicht richtíg, nehmen wir eine neue Aufgabe")
continue
else:
a = random.randint(1.1000)
b = random.randint(1.1000)
print("Die Zahlen zum Subtrahieren sind:". a. b)
c = a - b
if c == int(input()):
print("Das ist richtig, auf ein Neues")
continue
else:
print("Das ist leider nicht richtíg, nehmen wir eine neue Aufgabe")
continue
Traceback (most recent call last):
File "/home/phil/Arbeitsfläche/Python3.2/Python_Project/Calcone.py", line 23, in <module>
a = random.randint(1.1000)
TypeError: randint() takes exactly 3 arguments (2 given)