第四天啦,今天依旧代码少的啃树皮....
但是作业留的有了幼儿园的水准!!!让小编我看到了希望....
#!/usr/bin/env python
# -*- coding:utf8 -*-
import time
count = 0
while count < 10:
print ("ok",time.time())
#count = 100
count = count + 1
print (123)
#1.使用while循环输入1 2 3 4 5 6 8 9 10
num = 1
while num <= 10:
if num == 7:
pass
num = num + 1
else:
print (num)
num = num + 1
#2.求1-100相加数之和
num1 = 1
num = 0
while num1 <=100:
num = num + num1
num1 = num1 + 1
print (num)
#3.输出1-100内所有奇数
n = 1
while n < 101:
temp = n % 2
if temp == 0:
pass
else:
print (n)
n = n + 1
print ('----end----')
#4.输出1-100内所有偶数
n = 1
while n < 101:
temp = n % 2
if temp == 0:
print (n)
else:
pass
n = n + 1
#5.求1-2+3-4+5...99所有数和
n = 1
s = 0
while n < 100:
temp = n % 2
if temp == 0:
s = s - n
else:
s = s + n
n = n + 1
print (s)
#6.用户登录三次机会
number = 1
while number <= 3:
inp = input ("input password: ")
if inp == "123":
print ("OK")
break
else:
print ("EOFError")
number = number + 1