python infinite loop

If the conditional statement is always true, infinite loop will execute it, the following examples:

 

# ! / Usr / bin / Python 
# - * - Coding: UTF-8 - * - 
 
var = 1
 the while var == 1:   # This condition is always true, the loop will continue to perform unlimited 
   NUM = raw_input ( " the Enter A Number The: " )
    Print  " by You entered: " , NUM 
 
Print  " Good BYE! "

 

Guess you like

Origin www.cnblogs.com/furuihua/p/11233182.html