Author Topic: Python - how to find the size of the array  (Read 795 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Python - how to find the size of the array
« on: January 04, 2012, 04:02:41 pm »
len is the function name you need to use to find the length of the array. It takes the array variable name as input.

Code: (Python)
#Python Source File


s = [ 10, 20, 30, 40, 50, 60 ]
print len (s)

# The output would be 
# 6

« Last Edit: January 04, 2012, 04:04:44 pm by kathir »

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1