Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Check if a list exists in given list of lists
Post: RE: Check if a list exists in given list of lists

Solved it by adding changing to this: for elem in src_edges_weightless: if collections.Counter(elem) == collections.Counter(possible_edge): if elem[0] ...
Daniel94 Homework 2 2,248 Apr-06-2020, 05:45 PM
    Thread: Check if a list exists in given list of lists
Post: Check if a list exists in given list of lists

I want to check if a list of tuples contains a specific tuple. If numbers = [('a','a'), ('c','a')] look = ('a','c')"look" should not be contained in "numbers". But that's how my code thinks right now...
Daniel94 Homework 2 2,248 Apr-06-2020, 04:35 PM
    Thread: Compare elements of tuples / Find edges between nodes
Post: Compare elements of tuples / Find edges between no...

[Image: https://i.ibb.co/G2jWRm7/result.png] I want to check if any of the tuples my list contain the specific variables “x” and “y”. If tuple 1 contain “x”,”x” and tuple 2 contain “y”, “y” return sh...
Daniel94 Homework 1 1,794 Apr-05-2020, 09:09 PM
    Thread: Print Binary Tree - Python
Post: Print Binary Tree - Python

def show_2d(self): ''' Show a pretty 2D tree based on the output of bfs_order_star(). None values are are replaced by stars ('*'). For example, consider the following tree `t`: ...
Daniel94 Homework 1 2,672 Jan-08-2020, 09:41 PM
    Thread: Return size of binary tree
Post: Return size of binary tree

So I am an absolute beginner beginner with python. I want to write a function that returns the size of a binary tree. Here's my attempt that don't work: def size(self): ''' Retur...
Daniel94 Homework 1 1,966 Jan-05-2020, 12:52 PM

User Panel Messages

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