I know several languages, Python is not one of them and I don't really want to learn it. I've got some demo code in Python I want to deconstruct before implementing the algorithm in Kotlin. The demo code creates an array via
I want to print 'pos' and don't like the way 'print(pos)' looks. What I want is something like:
This will be my last Python question, pinky swear.
edit: The 'np' in np.random.rand(2) is numpy.
Code:
nodes = [0, 1, 2, 3, 4, 5, 6]
pos = {node: np.random.rand(2) for node in nodes}
Code:
0 1.2345 -4.331
1 5.6789 4.56
etc
edit: The 'np' in np.random.rand(2) is numpy.
Last edited:
