>>> def test():
... a1 = int(input('2+4='))
... f = 'False, try again'
... t = 'True'
... if a1==6:
... print(t)
... else:
... print(f)
... a2 = int(input('5+8='))
... if a2==13:
... print(t)
... else:
... print(f)
... a3 = int(input('13+18='))
... if a3==31:
... print(t)
... else:
... print(f)
...
>>>
>>> test()
2+4=6
True
>>>
>>> test()
2+4=5
False, try again
5+8=13
True
>>>
>>> test()
2+4=1
False, try again
5+8=2
False, try again
13+18=31
True
>>>
>>> test()
2+4=1
False, try again
5+8=2
False, try again
13+18=3
False, try again
>>>
>>> def test():
... f = 'False, try again'
... t = 'True'
... while True:
... a1 = int(input('2+4='))
... if a1==6:
... print(t)
... break
... print(f)
... while True:
... a2 = int(input('5+8='))
... if a2==13:
... print(t)
... break
... else:
... print(f)
... while True:
... a3 = int(input('13+18='))
... if a3==31:
... print(t)
... break
... else:
... print(f)
...
>>> test()
2+4=1
False, try again
2+4=2
False, try again
2+4=3
False, try again
2+4=6
True
5+8=1
False, try again
5+8=2
False, try again
5+8=3
False, try again
5+8=13
True
13+18=1
False, try again
13+18=2
False, try again
13+18=3
False, try again
13+18=31
True
>>>