Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Converting List of 3 Element Tuple to Dictionary
Post: RE: Converting List of 3 Element Tuple to Dictiona...

(Jan-11-2019, 04:27 PM)DeaD_EyE Wrote: result = [] for element in data:     sorted_tuple = sorted(element)     result.append(sorted_tuple) print(result)It worked Many thanks!!!
fooikonomou General Coding Help 11 5,840 Jan-11-2019, 09:17 PM
    Thread: Converting List of 3 Element Tuple to Dictionary
Post: RE: Converting List of 3 Element Tuple to Dictiona...

And how this can be done? Let's say I have this list: [(1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 1, 4), (1, 1, 5), (1, 1, 6), (1, 2, 1), (1, 2, 2), (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 2, 6), (1, 3, 1), (1...
fooikonomou General Coding Help 11 5,840 Jan-11-2019, 01:13 PM
    Thread: Converting List of 3 Element Tuple to Dictionary
Post: RE: Converting List of 3 Element Tuple to Dictiona...

mylist = [(x,y,z) for x in range(1,7) for y in range(1,7) for z in range(1,7)] count=0 combs=[] counts = dict() for data in mylist: if data not in counts: counts[data] =1 ...
fooikonomou General Coding Help 11 5,840 Jan-11-2019, 02:38 AM
    Thread: Converting List of 3 Element Tuple to Dictionary
Post: RE: Converting List of 3 Element Tuple to Dictiona...

What should I enter for key?
fooikonomou General Coding Help 11 5,840 Jan-10-2019, 04:04 AM
    Thread: Converting List of 3 Element Tuple to Dictionary
Post: Converting List of 3 Element Tuple to Dictionary

I have one 3d list of tuple list=[(0, 1, 6), (5,1,4), (1, 6, 0), (3, 2,1),(4,5,1)]I want to add in a dictionary like this: { (0,1,6): 2, (4,5,1): 2, (3,2,1): 1 }I want to count the similar tuple...
fooikonomou General Coding Help 11 5,840 Jan-10-2019, 03:38 AM

User Panel Messages

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