I am beginner in Python and I am solving a question at CodeChef where I have to read a line of space separated integers. This is what I am doing:
def main():
t=int(raw_input()) #reading test-cases
while t!=0:
n, k=raw_input().split() #reading a line of two space separated integers
n, r=int(n), int(r) #converting them into int
list=[]
#reading a line of space separated integers and putting them into a list
list[-1:101]=raw_input().split()
Now I to convert each element in the list to integer. Is there some better way to to do this? Please suggest an online resource where I can play with Python and learn tips and tricks!