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, 2019 in Python by Waseem
• 4,540 points
235 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, 2019 by Mohammad
• 3,210 points

Related Questions In Python

+1 vote
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, 2019 in Python by Kishore
104 views
0 votes
1 answer

How do I trim the leading or trailing zeros from a 1d array in python?

Hey @Akki, you can use the numpy ...READ MORE

answered May 29, 2019 in Python by Wakir
527 views
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,465 views
0 votes
0 answers
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, 2019 in Python by Mohammad
• 3,210 points
136 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, 2019 in Python by Mohammad
• 3,210 points
95 views