On Mon, Apr 11, 2011 at 1:01 PM, Sophie DeNofrio <[email protected]>wrote:
> Hi Everyone,
>
> I am a super beginner and am little muddled right now. So I apologize for
> the low level question but I am trying to write a function that will return
> a dictionary of a given list of strings containing two coordinates separated
> by a space with the first numbers as a key and the second numbers as its
> corresponding value. I thought maybe a set might be helpful but that didn't
> seem to work at all. I am pretty much as confused as they come and any help
> would be very much appreciated. Thank you so much for your time.
>
def createDictionary(data):
result = {}
for datapiece in data:
# Code here to make coordinate1 and coordinate2 the values you want
# Leaving that part to you, but feel free to ask again if you fail
result[coordinate1] = coordinate2
return result
--
André Engels, [email protected]
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor