The problem is to count the elements in a list without using len(list).
My code:
def countFruits(crops):
count = 0
for fruit in crops:
count = count + fruit
return count
The error was: 'int' and 'str'
These are supposed to be the test cases that should run the program.
crops = ['apple', 'apple', 'orange', 'strawberry', 'banana','strawberry', 'apple']
count = countFruits(crops)
print count
7