-1
x1 = int(input())
v1 = int(input())
x2 = int(input())
v2 = int(input())
if x1 == x2 and v1 == v2:
print('SIM')
elif (x1 == x2) and (v1 != v2):
print('NÃO')
elif (x1 - x2) % (v2 - v1) == 0:
if (x1 - x2) / (v2 - v1) > 0:
print('SIM')
else: print('NAO')
else: print('NAO')
I made that code and I realized that the %
and the /
totally change the result. What is the difference between them?
%
take the rest of the division/
normal division operator in some cases(python 2.7) takes only the entire part of the division– Bernardo Lopes