Please can anybody help me, i want to create a adjacency list based on user input. so for the following user input
C-C-C-C
| |
C C
|
C
it would output
carbongraph = {"1":["2"], "2":["1","3","5"], "3":["2","4","6"], "4" :["3"], "5":["2","7"], "6":["3"], "7":["5"]}
as it reads from left to right, top to bottom as if reading a book
just tell me how to Number the C's from 1 to 7 rom left to right, top to bottom as if reading a book, i will figure the rest out myself.
somebody please answer me i have been stuck for days.
What I have tried:
I have tried using enumerate but i just cant get past how to get round it.