saraarmaroli
saraarmaroli
``` def test_fib(n,expected): result=fib(n) if expected==result: return True else: return False def fib(n): if n
``` from networkx import Graph tim_berners_graph = MultiGraph() tim_berners_graph.add_node("Tim Berners Lee") tim_berners_graph.add_node("Christian Bizer") tim_berners_graph.add_node("Tom Heath") tim_berners_graph.add_node("Sören Auer") tim_berners_graph.add_node("Michael Hausenblas") tim_berners_graph.add_node("Kingsley Idehen") tim_berners_graph.add_edge("Tim Berners Lee", "Christian Bizer", weight=17) tim_berners_graph.add_edge("Tim Berners Lee",...
from networkx import DiGraph actor_movie = DiGraph() #actors nodes actor_movie.add_node("Brad Pitt") actor_movie.add_node("Eva Green") actor_movie.add_node("George Clooney") actor_movie.add_node("Catherine Zeta Jones") actor_movie.add_node("Johnny Depp") actor_movie.add_node("Helena Bonham Carter") #movies nodes actor_movie.add_node("Ocean's Twelve") actor_movie.add_node("Fight Club") actor_movie.add_node("Dark...
my_set = set() my_set.add("Bilbo") my_set.add("Frodo") my_set.add("Sam") my_set.add("Pippin") my_set.add("Merry") print(my_set) #my_set: {'Pippin', 'Sam', 'Frodo', 'Bilbo', 'Merry'}
my_queue = deque(["Draco", "Harry", "Hermione", "Ron", "Severus"]) my_queue.popleft () # Draco is remove, because in this case the first it’s the first out my_queue = deque([ "Harry", "Hermione", "Ron", "Severus"])...
harry_potter_list=list () harry_potter_list.append (“Draco”) harry_potter_list.append (“Harry”) harry_potter_list.append (“Hermione”) harry_potter_list.append (“Ron”) harry_potter_list.append (“Severus”) Print(harry_potter_list)
my_stack = deque(["Draco", "Harry", "Hermione", "Ron", "Severus"]) my stack.pop () # i Remove Severus, the element on the top of my stack my_stack = deque(["Draco", "Harry", "Hermione", "Ron"]) my stack.pop...
not (not true or false and true) or false not (**false** or false and true ) or false not (flase or **false**) or false not (**false**) or false **true** or...