>>> temp = int(input('Entre com a temperatura: '))
Entre com a temperatura: 23
>>> if temp < 0:
print('Congelando...')
elif 0 <= temp <= 20:
SyntaxError: invalid syntax
>>>
尝试更改标签但不起作用:
>>> temp = int(input('Entre com a temperatura: '))
Entre com a temperatura: 23
>>> if temp < 0:
print('Congelando...')
elif 0 <= temp <= 20:
SyntaxError: unindent does not match any outer indentation level
>>>
答案 0 :(得分:1)
我怀疑elif
之前有空格或标签。尝试退格,直到elif
位于提示>>>