Hi,

How give input to a list all at once. 
I mean if we declared a array and like to take input for it

for (i=0;i<5;i++)
     scanf("%d",&array[i]);
here we can give input of 5 numbers with a space in command prompt. 

Similarly in python if i create a list and do similar process 

list = [ [ ], [ ] ]
for i in range (0,2):
        for j in range (0, 2):
                 list[i].append ( int (raw_input()) )

here, I am expecting a list like
[ [1,2] , [3,4] ] 

but when I give 1,2,3,4 with space in command prompt at once, it shows error.

How do i overcome this problem? 
        
Actually my problem goes to sudoku solver where i need to take input all at 
once. What should i do ? 

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to