Error SyntaxError in if statement: invalid character identifier [overlapping]

Asked 2 years ago, Updated 2 years ago, 201 views

(One answer) 4 months ago

I don't know where the mistake is, please let me know.

a=input("What is the tallest mountain in Japan?")
if a=="Mt. Fuji":
   print("Answer!")
elifa=="Fuji-san":
print("Let's write in Chinese characters")
else:
  print("Unfortunately, the tallest mountain in Japan is Mt. Fuji".")


File "<ipython-input-20-34bcf552f01a>", line 2
    if a=="Mt. Fuji":
       ^
SyntaxError: invalid character identifier

python

2022-09-30 22:02

1 Answers

The colon : symbols used in the if and elif lines are full-width : respectively.
Modify to half-width :.

full-width colon:search results in:

Enter a description of the image here


2022-09-30 22:02

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.