python练习 9:狂练打印

1.在打印一份字符串时,如果想要另起一行时。应该在字符串前面加“ ”

# Her's some new strange stuff,remember type it exactly.
days = "Mon Tue web Thu Fri Sat Sun"months = "Jan Feb Mar Apr May Jun Jul Aug"
print("Here are the days:", days )print("Here are the months:", months)print('''There's something going on here.With the three double-quotes.We'll be able to type as much as we like.Even 4 lines if we want, or 5, or 6.''')# print(" 1")

结果:

PS H:pythonpractice2.0> & C:/application/Anaconda/python.exe h:/python/practice2.0/ex9.py

Here are the days: Mon Tue web Thu Fri Sat Sun

Here are the months: Jan

Feb

Mar

Apr

May

Jun

Jul

Aug

There's something going on here.

With the three double-quotes.

We'll be able to type as much as we like.

Even 4 lines if we want, or 5, or 6.

展开阅读全文

页面更新:2024-05-12

标签:字符串

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号

Top