Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Count of sums
Post: RE: Count of sums

Thank you, Larz60+. I will examine your code too.
mattis General Coding Help 9 22,480 Oct-22-2018, 08:58 PM
    Thread: Count of sums
Post: RE: Count of sums

Thanks a lot! I got it now. Here is the final one: import itertools from collections import Counter totals = Counter() thelist = [0, 0, 0, 1, 1, 2, 2, 2] for L in range(5,6): for subset in itert...
mattis General Coding Help 9 22,480 Oct-22-2018, 08:44 PM
    Thread: Count of sums
Post: RE: Count of sums

thank you, Nilamo. I changed it like this with your suggestion. but I couldn't get the result. I am a new learner, what am I doing wrong here? please import itertools from collections import Counte...
mattis General Coding Help 9 22,480 Oct-22-2018, 08:36 PM
    Thread: Count of sums
Post: RE: Count of sums

When I run this script, I get a result that looks like this: (0, 0, 0, 1, 1) => 2 (0, 0, 0, 1, 2) => 3 (0, 0, 0, 1, 2) => 3 (0, 0, 0, 1, 1) => 2 (0, 0, 0, 1, 2) => 3 (0, 0, 0, 1, 2) =&...
mattis General Coding Help 9 22,480 Oct-22-2018, 08:21 PM
    Thread: Count of sums
Post: Count of sums

I would like to count sum(subsets) in the following code, how can i do this? thanks. import itertools thelist = [0, 0, 0, 1, 1, 2, 2, 1] for L in range(5,6): for subset in itertools.combinations...
mattis General Coding Help 9 22,480 Oct-22-2018, 07:55 PM

User Panel Messages

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