我的 python 代码有问题,无法发出哔哔声。它只是发出无限循环的哔哔声,即使它应该停止。
import winsound
import time
z = 1
while z == 1:
b = input('Enter number of beeps required')
print(b)
a = input('Is this number correct?')
if a == "yes":
print('Python shall use this number')
z = 2
if a == "no":
b = input('Enter number of beeps required')
x = 1
y = -1
while x == 1:
freq = 1500
dur = 50
winsound.Beep(freq,dur)
y += 1
if y == b:
x = 2
谢谢你的帮助