python study notes seven (while statement)

while statement:
Format:
while the expression:
(space) statement
logic : When the program executes the while statement is first calculated value "expression" if "expression" is false, then the end of the entire while statement; if " expression "is true, then execute" statement ", executing the" statement "to go to the implementation of" expression "value, if the" expression "is false, while the end of the entire statement; if the" expression " is true, then execute "statement", executing the "statement" to go to the implementation of the value of "expression" of. So on ad infinitum, until the "expression" is false stopped
string comparison Size:
rule : start with the first character comparisons, whose ASCII value greatly will come; if equal compare the next character ASCII size , then the value of large who will come to the big.
Part Example:
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
4. daffodils print out all the three digits
Here Insert Picture Description
5. Enter a number in the console, it is determined that it is not a prime number!
Here Insert Picture Description
6. From a console input character string, this string and prints out all numeric characters
Here Insert Picture Description
7. console input from a string, the string is determined how many words
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_38324954/article/details/94130900