1。用户输入一串英文和数字,只输出数字。
content = input(‘>>>‘).strip() for i in content: if i.isalpha(): content = content.replace(i," ") l = content.split() for i in l: print(i)
2.调换a和b的值,要求只能用一行代码实现。
a = 1
b = 2
a,b = b,a
标签:ext replace class post pre blog 试题 alpha gpo
1。用户输入一串英文和数字,只输出数字。
content = input(‘>>>‘).strip() for i in content: if i.isalpha(): content = content.replace(i," ") l = content.split() for i in l: print(i)
2.调换a和b的值,要求只能用一行代码实现。
a = 1
b = 2
a,b = b,a
标签:ext replace class post pre blog 试题 alpha gpo
原文地址:http://www.cnblogs.com/tsboy/p/8074677.html