1

Hello all how do I select just the first columns for this list so I only want to grab 1-11 and not the things inside the []

thank you!!

graph = {1: [9],

2: [3],

3: [4],

4: [6],

5: [6],

6: [8],

7: [2,8,9],

8: [11],

9: [],

10: [],

11: [10],


}
0

1 Answer 1

2

Your question is unclear, the input you provide is a dictionary. If you just want to grab the 1-11, that would be the dictionary keys: graph.keys()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.