Advertisement
Guest User

Kalkulator

a guest
Jan 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. for _ in range(int(input())):
  2.     Test=input().split()
  3.     if Test[0].isdigit() and Test[1].isdigit():
  4.         print(int(Test[0])+int(Test[1]))
  5.     elif Test[0].isdigit() or Test[1].isdigit():
  6.         if Test[0].isdigit():
  7.             numb=int(Test[0])
  8.             print(Test[1][numb-1])
  9.         else:
  10.             numb=int(Test[1])
  11.             print(Test[0][numb-1])
  12.     else:
  13.         print(Test[0]+Test[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement