我想尝试一个来自GameStateIntegration的脚本
def sendHealthStatus(health): # Send health status to arduino
if health == 100:
arduino.write('h')
arduino.write(str(health))
if health < 100 and >= 10:
arduino.write('h0')
arduino.write(str(health))
if health < 10 and >= 0:
arduino.write('h00')
arduino.write(str(health))`
但是我的
语法无效if health < 100 and >= 10:
实际上是'='符号,当我删除它时,它会告诉我'&gt;'是错误
该脚本出了什么问题?
来自德国的问候 的Björn
答案 0 :(得分:1)
用以下代码替换:
if health < 100 and health >= 10:
(比较的每一方都需要一个值)