如何修复Python中的ELIF预期表达误差
import win32api,time
while True:
a = win32api.GetKeyState(0x57)
if a <0:
print("w")
a = win32api.GetKeyState(0x53)
elif a <0:
print('s')
time.sleep(0.1)
我是新手,可以python行elif a&lt; 0
给我错误````预期expression''我该怎么做才能使它起作用?谢谢
import win32api,time
while True:
a = win32api.GetKeyState(0x57)
if a <0:
print("w")
a = win32api.GetKeyState(0x53)
elif a <0:
print('s')
time.sleep(0.1)
im super new to python the line elif a<0
gives me the error ```expected expression`` what do i do to make it work? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您使用> 时,结构时,您需要在代码中正确的凹痕,因为这将确定在某个时刻执行的说明:
You need a correct indentation in your code when you use
if
andwhile
structures, because that will determine the instructions that execute in a certain moment: