sum = 0
x = 1
n = 1
while True:
n += 1
sum = 1 + 2 * sum
if n > 20:
break
print sum
x = 1
n = 1
while True:
n += 1
sum = 1 + 2 * sum
if n > 20:
break
print sum
2019-03-18
def sum():
x = 1
sum = 0
for i in range(100):
sum += x
x += 3
return sum
print(sum())
x = 1
sum = 0
for i in range(100):
sum += x
x += 3
return sum
print(sum())
2019-03-18
print 'hello,python'
print 'hello+python'
print 'hello+python'
2019-03-17
L = [75, 92, 59, 68]
sum = 0.0
for i in L:
sum += i
print sum / 4
sum = 0.0
for i in L:
sum += i
print sum / 4
2019-03-16
L = ['Adam', 'Lisa', 'Paul', 'Bart']
L.pop(2)
L.pop(-1)
print L
L.pop(2)
L.pop(-1)
print L
2019-03-16
sum = 0
x = 0
while True:
x = x + 1
if x > 100:
break
if not x%2:
continue
sum = sum + x
print sum
x = 0
while True:
x = x + 1
if x > 100:
break
if not x%2:
continue
sum = sum + x
print sum
2019-03-15