Ask coding questions

← Back to all posts
TikTok User Gen
MatthewADev (18)

How do I remove this ELIF error? I'm trying to do a menu but it isn't working, any help is appreciated :D!

Answered by InvisibleOne (2979) [earned 5 cycles]
View Answer
Comments
hotnewtop
InvisibleOne (2979)

Under your if statement everything needs to be indented, and once it unindents there needs to be an elif statement. Your code currently looks like this:

if "bob" == "bob":
  print("Bob is bob")
print("Bla bla bla")
error = True
elif "bob" == "bill":
  print("Uhh...python..."

while you code needs to look like this:

if "bob" == "bob":
  print("Bob is bob")
  print("Bla bla bla")
  error = False
elif "bob" == "bill":
  print("Uhh...python..."
InvisibleOne (2979)

Give lines 47 through 58 an extra indent, select them and press TAB

MatthewADev (18)

@InvisibleOne THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IT WORKED

MatthewADev (18)

@InvisibleOne Oh and one more question, how do I use this fonts on your website? I'm thinking about coding in HTML, CSS, JS

InvisibleOne (2979)

I got the font from google fonts, I'll grab the code for you quick. @2I9

InvisibleOne (2979)

First you need to import the font, so put this at the top of your style.css file

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR&family=Zen+Dots&display=swap');

And then you can set the font with

font-family: 'Noto Sans KR', sans-serif;