can anyone look this python error :an illegal target for a variable annotation
Question:
Answers:
You need to change the If
to lowercase, to if
You also need to replace elif
with else
since elif
would not be used in this situation, else
would. elif
is used when the first condition is false, and the specified elif
condition is true. else
is used when just the first condition is false, with no other true condition.
Here’s the fixed code:
n = 1
if n > 25:
print("1")
else:
print("0")
(It gives no error in VSCode)
You need to change the If
to lowercase, to if
You also need to replace elif
with else
since elif
would not be used in this situation, else
would. elif
is used when the first condition is false, and the specified elif
condition is true. else
is used when just the first condition is false, with no other true condition.
Here’s the fixed code:
n = 1
if n > 25:
print("1")
else:
print("0")
(It gives no error in VSCode)