Python怎么将This is TOM字符串输出到三行,每行一个单词? python字符串怎么按行输出

Python\u600e\u4e48\u5c06I am a boy\u5b57\u7b26\u4e32\u8f93\u51fa\u5230\u56db\u884c,\u6bcf\u884c\u4e00\u4e2a\u5355\u8bcd \u6c42\u5927\u795e\u89e3\u7b54

a='I am a boy'
b=a.split()
for i in b:
print(i)


\u7b2c\u4e00\u4e2a\u95ee\u9898\uff0c\u591a\u884c\u5b57\u7b26\u4e32\u7528\u4e09\u4e2a\u5f15\u53f7\uff0c\u5f53\u7136\u5728\u975e\u8d4b\u503c\u7684\u60c5\u51b5\u4e0b\u4e09\u4e2a\u5f15\u53f7\u8868\u793a\u662f\u6ce8\u91ca\u3002\u3002 \u7b2c\u4e8c\u4e2a\u95ee\u9898\uff0c\u4f60\u53ef\u4ee5\u6309\u884c\u5c06\u5b57\u7b26\u4e32\u5206\u5272\u7136\u540e\u8f93\u51fa\u3002 str = """FirstSecondThird"""a = str.split("\n")for i in xrange(len(a)): print a[i] + ": " + str(i)

s="This is TOM"

print("
".join(s.split()))



扩展阅读:学python后到底能干什么 ... python手机版下载官方 ... c++和python先学哪个 ... python turtle seth ... python培训班学费一般多少 ... python基础语法菜鸟 ... 扇贝python怎么跳出死循环 ... 学python最佳年龄 ... 分行显示信息python ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网