fork download
  1. import ast
  2.  
  3. def calculate(number, operator):
  4. for i in range(1, 11): print(ast.literal_eval(number + operator + str(i)))
  5.  
  6.  
  7. inputs = list(input().split())
  8.  
  9. switch = {
  10. '1': '+',
  11. '2': '*',
  12. '3': '/',
  13. '4': '-',
  14. }
  15.  
  16. calculate(inputs[0], switch[inputs[1]])
Success #stdin #stdout 0.02s 27888KB
stdin
5 1
stdout
6
7
8
9
10
11
12
13
14
15