how do I check the length of an array in a python program?

0 votes
what is the most efficient way to find out the length of an array in a python program?
Mar 12 in Python by Waseem
• 4,480 points
44 views

1 answer to this question.

0 votes
lets say we have a list

mylist = [1,2,3,4,5]

len(mylist)

this will give you the length of the array.
answered Mar 12 by Mohammad
• 3,060 points

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

How do I convert type of an array in python?

Use the following command to change the ...READ MORE

answered May 24 in Python by Kishore
25 views
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 283 views
0 votes
1 answer

How can I find the square of a number in python?

You can use the exponentiation operator or ...READ MORE

answered May 20 in Python by Mohammad
• 3,060 points
35 views
0 votes
1 answer

how do i check for exceptions in python?

use self.assertRaises method as a context manager. def ...READ MORE

answered Mar 12 in Python by Mohammad
• 3,060 points
46 views