Python continue statement

The Python continue with declaration jumps out of this circle, and break bobs unware of current conditions.

The

continue clarification is used to inform Python to skirt the rest with respect to the declarations of the present circle and a short time later proceed to the accompanying cycle.

The

continue declaration is used in while and for circles.

Python language The continue with decree accentuation is as follows:

continue

Flowchart:

Instance(Python 2.0+)

#!/usr/bin/python # -*- coding: UTF-8 -*- for letter in 'Python': # First instance if letter == 'h': continue print 'Current letter :', letter var = 10 # Second instance while var > 0: var = var -1 if var == 5: continue print 'Current variable value :', var print "Good bye!"

The above example execution results´╝Ü

Current letter : P
Current letter : y
Current letter : t
Current letter : o
Current letter : n
Current variable value : 9
Current variable value : 8
Current variable value : 7
Current variable value : 6
Current variable value : 4
Current variable value : 3
Current variable value : 2
Current variable value : 1
Current variable value : 0
Good bye!





welookups is optimized for learning.© welookups 2018 -
All Right Reserved and you agree to have read and accepted our term and condition