print 'hello, python.'
print 'hello,','python.'
print 'hello,','python.'
2019-05-15
# -*- coding: utf-8 -*-
print '''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
print '''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
2019-05-15
最新回答 / qq_慕神6366216
def average(*args): if len(args) == 0 : return 0.0 else: return sum(args)*1.0/len(args) print average()print average(1, 2)print average(1, 2, 2, 3, 4)
2019-05-15
最后一道题6-10set更新,综合了一下前面的for和if
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for L1 in L:
if L1 in s:
s.remove(L1)
else:
s.add(L1)
print s
s = set(['Adam', 'Lisa', 'Paul'])
L = ['Adam', 'Lisa', 'Bart', 'Paul']
for L1 in L:
if L1 in s:
s.remove(L1)
else:
s.add(L1)
print s
2019-05-13
sum = 1
x = 1
while True:
x=x+1
if x>100:
break
if x%2==0:
continue
sum=sum+x
print sum
x = 1
while True:
x=x+1
if x>100:
break
if x%2==0:
continue
sum=sum+x
print sum
2019-05-13