sum = 0
x = 1
while x < 100:
sum = sum + x
x = x + 2
print sum
x = 1
while x < 100:
sum = sum + x
x = x + 2
print sum
2015-12-11
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
print L[2]
话说是三个同学,第四名在哪里呢?
print L[0]
print L[1]
print L[2]
print L[2]
话说是三个同学,第四名在哪里呢?
2015-12-11
t = ('a', 'b', ('A', 'B'))
print t
t = ('a', 'b', ['A', 'B'])
print t
print t
t = ('a', 'b', ['A', 'B'])
print t
2015-12-10
t = ('Adam')
print t
t = ('Adam',)
print t
t = ('Adam','abc')
print t
t = ('Adam','abc',)
print t
print t
t = ('Adam',)
print t
t = ('Adam','abc')
print t
t = ('Adam','abc',)
print t
2015-12-10
L = ['Adam', 'Lisa', 'Bart']
a=L[0]
L[0]=L[2]
L[2]=a
print L
L=[L[2],L[1],L[0]]
print L
L[0]=L[-1]
L[2]=L[-3]
print L
a=L[0]
L[0]=L[2]
L[2]=a
print L
L=[L[2],L[1],L[0]]
print L
L[0]=L[-1]
L[2]=L[-3]
print L
2015-12-10
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop(2)
print L
L.pop(2)
print L
L.pop(2)
print L
L.pop(2)
print L
2015-12-10
L = ['Adam', 'Lisa', 'Bart']
L.insert(2,'Paul')
print L
L.insert(2,'Paul')
print L
2015-12-10
L = [95.5, 85, 59]
print L[-1]
print L[-2]
print L[-3]
print L[-4]
print L[-1]
print L[-2]
print L[-3]
print L[-4]
2015-12-10
L = [95.5,85,59]
print L[0]
print L[1]
print L[2]
#print L[3]
print L
print L[0]
print L[1]
print L[2]
#print L[3]
print L
2015-12-10
L = ["Adam", 95.5, 'Lisa', 85, 'Bart', 59]
print L
print L
2015-12-10