摘要: 多线程 import threading import time def dance(): for i in range(3): print("跳舞") time.sleep(6) def sing(): for i in range(3): print("唱歌") time.sleep(6) if 阅读全文
posted @ 2025-12-21 12:15 Annaprincess 阅读(2) 评论(0) 推荐(0)
摘要: 1.单进程 import time def dance(): for i in range(3): print("跳舞") time.sleep(6) def sing(): for i in range(3): print("唱歌") time.sleep(6) if __name__ == '_ 阅读全文
posted @ 2025-12-21 12:14 Annaprincess 阅读(4) 评论(0) 推荐(0)
摘要: python复习 一.类型转换 # 自动向上转换 x = 10 + 5.5 # int + float → float y = True + 1 # bool + int → int (True=1) 当bool类型与int类型进行计算时会自动将True转化为1(int型),False转为0(int 阅读全文
posted @ 2025-12-21 10:43 Annaprincess 阅读(5) 评论(0) 推荐(0)