print("这是一句中英文混合的%s字符串:%s"%("python","Hello\tWorld"))
2021-06-02
template1="Life is short"
template2="you need python"
print("{0},{1}".format(template1,template2))
template="{L},{y}"
L="life is short"
y="you need python"
print(template.format(L=L,y=y))
template2="you need python"
print("{0},{1}".format(template1,template2))
template="{L},{y}"
L="life is short"
y="you need python"
print(template.format(L=L,y=y))
2021-06-02
print(r'''"To be, or not to be":that is the question
Whether it's nobler in the mind to suffer.''')
Whether it's nobler in the mind to suffer.''')
2021-06-02
已采纳回答 / 小白白白净
遍历过程中对集合 s 执行 remove 和 add 操作会导致集合 s 的 size 发生改变。即引发RuntimeError: Set changed size during iteration异常
2021-05-31
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
S=[89, 72, 88, 79, 99]
Ss=[89, 72, 88, 79, 99]
def getnames(name):
return Ss.index(name)
S.sort(reverse=True);
for sa in S:
print(sa)
print(L[getnames(sa)])
print(r'''
''')
S=[89, 72, 88, 79, 99]
Ss=[89, 72, 88, 79, 99]
def getnames(name):
return Ss.index(name)
S.sort(reverse=True);
for sa in S:
print(sa)
print(L[getnames(sa)])
print(r'''
''')
2021-05-31
a = 'python'
print('hello,'+( a or 'world'))
b = ''
print('hello,'+(b or 'world'))
print('hello,'+( a or 'world'))
b = ''
print('hello,'+(b or 'world'))
2021-05-31
L = [95.5, 85, 59, 66, 72]
L.sort(reverse=True)
for i in range(3):
print(L[i])
L.sort(reverse=True)
for i in range(3):
print(L[i])
2021-05-29