Access information of containing list in python
<p>I'm writing a script that can help me documenting our network rooms.</p>

<p>The idea behind that script is that a room is a list, that contains several lists for the racks. The rack lists contain lists called module with the servers/switches/etc. in the module list are the actual ports with the cable numbers.</p>

<p>For example:</p>

<pre><code>[04/02, [MM02, [1, #1992, 2, #1993, 3, #1567 ....], MM03, [1, #1234 .....]], 04/03, [MM01, .........]]]
</code></pre>

<p><code>04/02</code> = First Rack</p>

<p><code>MM02</code> = First module in that rack</p>

<p><code>1</code> = Port number</p>

<p><code>#1992</code> = Cable number</p>

<p>I hope you get the idea.</p>

<p>The script I wrote compares the cable numbers in the room list, and looks if there are duplicates. Now it gets tricky: It should then replace the cable number with the rack and module of the other port. That should be pretty easy, because module and rack are the first elements of those lists that contain the port, but I don't know how to get access to the information. (I'm a noob in programming)</p>
