python - How to fix an Empty output for STDERR? -
my program working , printing correct stdout stderr i'm getting ''empty output stream''
can fix code?, i'm stuck here.
input
285 242 2053 260 310 450 10 682
output
207229
my code
def sum_leaves(k, inputs, count=1): a, b, m, l1, l2, l3, d, r = map(int, inputs) x = (((a*k)+b) % m) y = (((a*k)+2*b) % m) if k < l1 or count == d: my_list.append(k) elif l1 <= k < l2: sum_leaves(x, inputs, count + 1) elif l2 <= k < l3: sum_leaves(y, inputs, count + 1) elif l3 <= k: sum_leaves(x, inputs, count + 1) sum_leaves(y, inputs, count + 1) if count == 1: return sum(my_list) def read_input(input_string): inputs = input_string.split() a, b, m, l1, l2, l3, d, r = map(int, inputs) x = (((a*r)+b) % m) y = (((a*r)+2*b) % m) if l1 <= r < l2: return sum_leaves(x, inputs) elif l2 <= r < l3: return sum_leaves(y, inputs) elif l3 <= r: sum_leaves(x, inputs) return sum_leaves(y, inputs) my_list = [] if __name__ == '__main__': print(read_input(input()))
you aren't sending stderr
. print()
sends stdout
. use print("error", file=sys.stderr)
send stderr
.
Comments
Post a Comment