摘要: # 若元组只有一个元素,要在后面加上',' def test_turple(): # 空元组 a = () print(type(a)) # <class 'tuple'> # 不是元组 b = ('hello') print(type(b)) # <class 'str'> c = (100) p 阅读全文
posted @ 2021-04-23 00:41 菜鸡要加油 阅读(22) 评论(0) 推荐(0) 编辑
摘要: import os import time # 在终端中显示跑马灯(滚动)文字。 def print_scroll(): content = '北 京 欢 迎 你 为 你 开 天 辟 地 ' while True: # Windows清除屏幕上的输出 os.system('cls') # macOS 阅读全文
posted @ 2021-04-23 00:09 菜鸡要加油 阅读(31) 评论(0) 推荐(0) 编辑