Loop to print the distance of every node from source vertex
for i in range ( len ( dist ) ) : NEW_LINE INDENT if ( dist [ i ] == infi ) : NEW_LINE INDENT print ( " { 0 } ▁ and ▁ { 1 } ▁ are ▁ not ▁ " + " connected " . format ( i , s ) ) ; NEW_LINE continue ; NEW_LINE DEDENT print ( " Distance ▁ of ▁ { } th ▁ vertex ▁ from ▁ source ▁ vertex ▁ { } ▁ is : ▁ { } " . format ( i , s , dist [ i ] ) ) ; NEW_LINE DEDENT