Mar-16-2021, 10:27 AM
I am learning about lists and apparently list.count does not function in the following:
When I use .insert, .reverse, .extend all is well!
Am I likely to have a problem with the Python package I am using?
I am using Windows 10 and Python 3.9.2
Any help would be appreciated
mylist = [5, 12, 27, 3, 12, 5, 9, 5, 11] mylist.count(3) print(mylist)The output I get is
Output:[5, 12, 27, 3, 12, 5, 9, 5, 11]
whereas it should return 1When I use .insert, .reverse, .extend all is well!
Am I likely to have a problem with the Python package I am using?
I am using Windows 10 and Python 3.9.2
Any help would be appreciated