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
2018-04-19
s = set([('Adam', 95), ('Lisa', 85), ('Bart', 59)])
for (name,score) in s:
print '%s:%s'%(name,score)
for (name,score) in s:
print '%s:%s'%(name,score)
2018-04-19
d = {
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for (key,value) in d.items():
print '%s:%s'%(key,value)
'Adam': 95,
'Lisa': 85,
'Bart': 59
}
for (key,value) in d.items():
print '%s:%s'%(key,value)
2018-04-19
temp = 0.0
g = args
# print args
y = 0.0
if len(args) > 0:
for x in g:
# print str(x)+'----------------'
temp = temp + x
# print '('+str(temp)+')'
y = y + 1
# print '==========='+str(y)
print temp/y
return temp/y
else :
return 0
花式打日志(。0.0。)
g = args
# print args
y = 0.0
if len(args) > 0:
for x in g:
# print str(x)+'----------------'
temp = temp + x
# print '('+str(temp)+')'
y = y + 1
# print '==========='+str(y)
print temp/y
return temp/y
else :
return 0
花式打日志(。0.0。)
2018-04-19
sum = 0
x = 0
while True:
x = x + 1
if x > 100:
break
if x%2==0:
continue
sum+=x
print sum
x = 0
while True:
x = x + 1
if x > 100:
break
if x%2==0:
continue
sum+=x
print sum
2018-04-19
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for name in L:
if name in s:
s.remove(name)
else:
s.add(name)
print s
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for name in L:
if name in s:
s.remove(name)
else:
s.add(name)
print s
2018-04-19