[Tutor] Python Code Error

Mark Lawrence breamoreboy at yahoo.co.uk
Thu May 29 21:33:41 CEST 2014


On 29/05/2014 10:48, Jude Mudannayake wrote:

[snipped to pieces]

for i in range(0,len(Ay11)):
     k1 = (Ay11[i],Az11[i])
     #print k1
     myList=k1
     xyCoordsInner = tuple(myList)
     #print xyCoordsInner

Further to the reply from Alan Gauld, if you're writing code like this 
in Python you're almost certainly doing it wrong.  For loops usually 
look like this.

for ay in Ay11:
     doSomeThingWithAy(ay)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com




More information about the Tutor mailing list