Python Forum
list.count does not appear to function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
list.count does not appear to function
#5
Thank you Sandeep_ganga, snippsat & Buran.
I get that - I was not using the print statement correctly not recognising I had called up print the original list and not the count result. However if I use mylist.reverse I have to revert to the my initial way of working as belowL
mylist = [5, 12, 27, 3, 12, 5, 9, 5, 11]
mylist.reverse()
print(mylist)
which gives the correct output of
Output:
[11, 5, 9, 5, 12, 3, 27, 12, 5]
Is this because I am using () in the call and not specifying anything between ()?

Thanks
Reply


Messages In This Thread
RE: list.count does not appear to function - by Oldman45 - Mar-16-2021, 01:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Function to count words in a list up to and including Sam Oldman45 15 6,776 Sep-08-2023, 01:10 PM
Last Post: Pedroski55
  Row Count and coloumn count Yegor123 4 1,388 Oct-18-2022, 03:52 AM
Last Post: Yegor123
  For Word, Count in List (Counts.Items()) new_coder_231013 6 2,686 Jul-21-2022, 02:51 PM
Last Post: new_coder_231013
  How to get unique entries in a list and the count of occurrence james2009 5 3,040 May-08-2022, 04:34 AM
Last Post: ndc85430
  count item in list korenron 8 3,549 Aug-18-2021, 06:40 AM
Last Post: naughtyCat
  How to use the count function from an Excel file using Python? jpy 2 4,499 Dec-21-2020, 12:30 AM
Last Post: jpy
  List of error codes to find (and count) in all files in a directory tester_V 8 3,790 Dec-11-2020, 07:07 PM
Last Post: tester_V
  Count number of occurrences of list items in list of tuples t4keheart 1 2,409 Nov-03-2020, 05:37 AM
Last Post: deanhystad
  count each element in a list glennford49 9 4,152 May-01-2020, 11:20 AM
Last Post: glennford49
  I created a function that generate a list but the list is empty in a new .py file mrhopeedu 2 2,350 Oct-12-2019, 08:02 PM
Last Post: mrhopeedu

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020