I am a beginner and need help with a bit of code:
print('welcome to multiply land, where you must earn respect by getting questions correct')
want_to_play = input('want to play. y/n ')
if want_to_play == 'y':
high = int(input('what is the highest times table you want?'))
low = int(input('what is the lowest times table you want?'))
os.system('cls' if os.name=='nt' else 'clear')
print('ready')
time.sleep (1)
os.system('cls' if os.name=='nt' else 'clear')
print('steady')
time.sleep (1)
os.system('cls' if os.name=='nt' else 'clear')
print ('go')
time.sleep (1)
os.system('cls' if os.name=='nt' else 'clear')
while lives > 0:
os.system('cls' if os.name=='nt' else 'clear')
digit1 = random.randint(low, high)
digit2 = random.randint(low, high)
print('♡ = {lives}'.format(lives=lives))
print('respect = {respect}'.format(respect=respect))
anser = int(input('{digit1} X {digit2} '.format(digit1=digit1, digit2=digit2)))
if anser == digit1 * digit2:
os.system('cls' if os.name=='nt' else 'clear')
respect += random.randint(1, 5)
print('well done')
else:
life -= 1
else:
print('bye')
but more specifically:
print('respect = {respect}'.format(respect=respect))
anser = int(input('{digit1} X {digit2} '.format(digit1=digit1, digit2=digit2)))
if anser == digit1 * digit2:
os.system('cls' if os.name=='nt' else 'clear')
respect += random.randint(1, 5)
print('well done')
this ( os.system('cls' if os.name=='nt' else 'clear')) is where the error occurs, any help is exepted.
I have tried replacing tabs with spaces and spaces with tabs and please comment if you need more information.
thanks
PS. this is all of the code but is it not complete