for x in [1,2,3,4,5,6,7,8,9]:
for y in[0,1,2,3,4,5,6,7,8,9]:
if x < y:
print x*10 + y
for y in[0,1,2,3,4,5,6,7,8,9]:
if x < y:
print x*10 + y
2019-01-24
for x in [ '1','2','3','4','5','6','7','8' ]:
for y in [ '2','3','4','5','6','7','8','9' ]:
if x < y:
print x + y
for y in [ '2','3','4','5','6','7','8','9' ]:
if x < y:
print x + y
2019-01-24
sum = 0
x = 0
while True:
x = x + 1
if x > 100:
break
if x % 2 == 0:
continue
sum = sum + x
print sum
x = 0
while True:
x = x + 1
if x > 100:
break
if x % 2 == 0:
continue
sum = sum + x
print sum
2019-01-24
sum = 0
x = 1
n = 1
while True:
sum = sum + x
x = x * 2
n = n + 1
if n > 20:
break
print sum
x = 1
n = 1
while True:
sum = sum + x
x = x * 2
n = n + 1
if n > 20:
break
print sum
2019-01-24
sum = 0
N = 100
x = 1
while x <= N:
sum = sum + x
x = x + 2
print sum
N = 100
x = 1
while x <= N:
sum = sum + x
x = x + 2
print sum
2019-01-24
L = [75, 92, 59, 68]
sum = 0.0
for name in L:
sum = sum + name
print sum / 4
sum = 0.0
for name in L:
sum = sum + name
print sum / 4
2019-01-24
score = 85
if score >= 90:
print 'excellent'
elif score >= 80:
print 'good'
elif score >= 60:
print 'passed'
else:
print 'failed'
if score >= 90:
print 'excellent'
elif score >= 80:
print 'good'
elif score >= 60:
print 'passed'
else:
print 'failed'
2019-01-24
score = 55
if score >= 60:
print 'passed'
else:
print 'failed'
print
if score >= 60:
print 'passed'
else:
print 'failed'
2019-01-24
L = [95.5, 85, 59]
print L[-1]
print L[-2]
print L[-3]
print L[-1]
print L[-2]
print L[-3]
2019-01-24
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print L[0]
print L[1]
print L[2]
2019-01-24
print ['Adam', 95.5, 'Lisa', 85,'Bart', 59]
2019-01-24
# -*- coding: utf-8 -*-
print ''' '静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。' '''
print ''' '静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。' '''
2019-01-23