How To Apply Reverse Loop In Python