一个好玩的闹钟
class Clock:id = None
price = None
def ring(self):
import time
import winsound
while True:
winsound.Beep(2000,3000)
time.sleep(5)
clock1 = Clock()
clock1.id = "002030"
clock1.price = 10.10
print(f"闹钟id:{clock1.id},价格:{clock1.price}")
clock1.ring()
页:
[1]