0

from livewires import *
rn = random_between(1,15)
rn1 = random_between(1,15)
print 'what is', rn , 'times', rn1 , read_number (': answer =') , ' answer is', ( rn * rn1 )
if (read_number (': answer =')) == ( rn * rn1 ):
print 'well done'
else:
print 'wrong'

Does anyone know why the 'read_number' function is executing a second time, it even executes if i try to give it a variable, any help would be much appreciated!

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by sneekula
0

Well, you are calling the read_number() function twice, so it will pop up twice. I don't have the livewires module, so I have to guess:

from livewires import *

rn = random_between(1,15)
rn1 = random_between(1,15)
print 'what is', rn , 'times', rn1, '? ', 
answer = read_number() 

if answer == ( rn * rn1 ):
    print 'well done'
else:
    print 'wrong, the answer is ', rn * rn1
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.