Answers for "create list of length"

1

how to make a use of list in python to make your own length function

def length(item):
  total_length = 0
  for how_many in item:
    total_length += 1
  return total_length
print(length([9,85,4,7,4])
Posted by: Guest on July-31-2021
3

python list of size

li = [None] * 5 # [None, None, None, None, None]
li = [0] * 5 # [0, 0, 0, 0, 0]
Posted by: Guest on May-16-2020

Code answers related to "create list of length"

Python Answers by Framework

Browse Popular Code Answers by Language