You are viewing a single comment's thread. Return to all comments →
while multiplying all the elements in a list and printing the output, how is
for i in list:
ans *= i
print (functools.reduce(op.mul, s, 1) % 1234567)
different. As, in one case solution is being accepted while in another it just passes only one testcase.
why we are using mod1234567
read format output again
fmod returns a float, so you will print extra .0 on each term
Forgetting to output mod some number is the #1 mistake I make on hackerrank problems.