Well without knowing what data your file contains, I'm going to assume each row contains only 2 comma separated values (weather, temperature).
So first:
val1 = val[0:3][9:16] will not do anything because what you're saying is to slice the val list between index 0 and 3 and then slice that slice with starting index of 9 to 16, which won't exist (because you just sliced it with 0:3), therefore you'll get an empty string in return.
If you'd like to compare multiple rows by batching those rows together, you'd probably want to do something along the lines of:
compare1 = val[0:3]
compare2 = val[9:16]
And then perform whatever 'comparison' level operations you'd like to do from there. I'm not sure why you'd do that though instead of just slicing the original val value however you want for each desired comparison.
For example, if you know:
row 1 contains 'New York, 60' and
row 12 contains 'San Francisco, 75'
And you'd like to compare the temperatures of these cities you can run:
val[0][1] < val[11][1] which would return 'True'
val1 = val[0:3] + val[9:16]?