Namespaces
Variants
Actions

Archived Talk:Python on Symbian/02. Basic Python Elements

Jump to: navigation, search

Echodoomyou - error

in the section of function, with the expample code:

def listaverage(aList):

  thesum = 0
  for x in aList:
     thesum += x
  print "Average is ",thesum/len(aList)

listaverage([1,2,3,4,5])

the return result should be:

Average is 3

instead of what has been written above:

Average is 2

echodoomyou 04:36, 23 October 2012 (EEST)

Croozeus - Rectified

Hi Echodoomyou,

Well spotted. I've now rectified this.

Thanks!

--Pankaj.

croozeus 06:33, 24 October 2012 (EEST)

 
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved