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!

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.