s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for x in L:
if x in s:
s.remove(x)
else:
s.add(x)
print s
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for x in L:
if x in s:
s.remove(x)
else:
s.add(x)
print s
2015-07-22
print [100*a+10*b+c for a in range(1,10) for b in range(0,10) for c in range (0,10) if a==c]
2015-07-22
L = []
for i in range(1,101):
print i
L.append(int(i*i))
print sum(L)
for i in range(1,101):
print i
L.append(int(i*i))
print sum(L)
2015-07-22
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for key in L:
if key in s:
s.remove(key)
else:
s.add(key)
print s
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for key in L:
if key in s:
s.remove(key)
else:
s.add(key)
print s
2015-07-22
for x in range(10)[1:]:
for y in range(10)[1:]:
if(x<y):
print x*10+y
for y in range(10)[1:]:
if(x<y):
print x*10+y
2015-07-22
for x in range(9)[1:]:
for y in range(9)[1:]:
if(x<y):
print x*10+y
for y in range(9)[1:]:
if(x<y):
print x*10+y
2015-07-22
sum = 0
x = 0
while True:
x = x + 1
if x > 100:
break
if x&1==0:
continue
sum = sum+x
print sum
x = 0
while True:
x = x + 1
if x > 100:
break
if x&1==0:
continue
sum = sum+x
print sum
2015-07-22
L = [75, 92, 59, 68]
sum = 0.0
for score in L:
sum += score
print sum / 4
sum = 0.0
for score in L:
sum += score
print sum / 4
2015-07-22
x1=1
d=3
n=1
s=0
while n<=100:
s=x1+3*(n-1)+s
n=n+1
print s
d=3
n=1
s=0
while n<=100:
s=x1+3*(n-1)+s
n=n+1
print s
2015-07-22
x1=1
d=3
n=1
s=0
if n>=100:
print s
else:
s=x1+3*(n-1)+s
n=n+1
d=3
n=1
s=0
if n>=100:
print s
else:
s=x1+3*(n-1)+s
n=n+1
2015-07-22