If10. Given two variables of integer type: A and B. If their values are not equal, then assign to each variable the sum of these values, and if equal, then assign variables to zero. Output new values of the variables A and B.

Solution in Python 3:

import random

A = random.randrange(-3,3)
B = random.randrange(-3,3)

print("Number A:", A)
print("Number B:", B)

if A != B:
A = B = A+B
else:
A = B = 0

print("Number A:", A)
print("Number B:", B)