This dictionary corresponds to numbered nodes:
{0: True, 1: True, 2: True, 3: False, 4: False, 5: False, 6: True, 7: True, 8: False, 9: False}
Using two print statements, I want to print marked and unmarked nodes as follows:
I want something close to:
print("Marked nodes: %d" key in markedDict if markedDict[key] = True) print("Unmarked nodes: %d" key in markedDict if markedDict[key] = False)
python dynamic printing inline
pooperdooper
source share