For printing nodes from right to left , push the nodes to stack instead of printing them .
else : NEW_LINE INDENT myStack . append ( temp ) NEW_LINE DEDENT if ( temp . left ) : NEW_LINE INDENT myQueue . append ( temp . left ) NEW_LINE DEDENT if ( temp . right ) : NEW_LINE INDENT myQueue . append ( temp . right ) NEW_LINE DEDENT if ( rightToLeft == True ) : NEW_LINE