day- 3while loop

'' ' 
1 cycle (Example a)
while
2 exercises
while output 1.2.3.4.5.6.8.9.10 1.
2. require that all numbers from 1 to 100, and
3. The output of all of the odd-numbered 1-100
4. output all even within 1-100
5. seeking 1-2 + 3-4 + 5-6 + ... + all 99 numbers and
6. user login (three opportunities) ''
' '
''
# Example one loop - loop.
Import Time
COUNT = 0
the while COUNT <10:
Print (COUNT)
COUNT = COUNT + 1
Print ( 'I love Python')

. # Example two loop - an endless loop
Import Time
the while 1 == 1 :
Print (Time)
Print ( 'I love Pytho')
'' '
# two exercises.
# 1 use while output 1.2.3.4.5.6.8.9.10.
the n-1 =
while the n-<11:
IF the n-== 7:
Pass
the else:
print(n)
+. 1 = n-n-

. # 2 all find the number of 1-100 and
n-. 1 =
S = 0
the while n-<101:
S = S + n-
n-n-+. 1 =
Print (S)
. #. 3 outputs 1-100 all odd
n-=. 1
the while n-<101:
TEMP = n-2%
IF TEMP == 0:
Pass
the else:
Print (n-)
n-n-+ =. 1
. #. 4 outputs all even within 1-100
n-=. 1
the while n- <101:
TEMP = n-2%
IF TEMP == 0:
Print (n-)
the else:
Pass
n-n-+ =. 1
.. 5 # 1-2 + 3-4 + 5-6 seeking + ... + the number of all 99 and
n-. 1 =
S = 0
the while n-<100:
TEMP = n-2%
IF TEMP == 0:
S = S - n-
else:
s = s + n
n = n + 1
print(s)

Guess you like

Origin www.cnblogs.com/pythonzhao/p/11618553.html