Skip to content

Instantly share code, notes, and snippets.

@RobertTalbert
Last active September 6, 2024 13:31
Show Gist options
  • Save RobertTalbert/5c304b12310c123fee8d7829b880e61c to your computer and use it in GitHub Desktop.
Save RobertTalbert/5c304b12310c123fee8d7829b880e61c to your computer and use it in GitHub Desktop.
# Python code for MTH 325 F24 Homework 5
## 1. Iterating through a list
vertex_list = [(2,3), (2,4), (4,5), (1,3)]
for vertex in vertex_list:
print(vertex[1])
## 2. A dictionary
my_graph = {
"a" : ["b", "c"],
"b" : ["a", "d"],
"c" : ["a", "d"],
"d" : ["e"],
"e" : ["d"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment