-4

what should I do?

I gave this error:

mylist=input('please inter your condition :')
If mylist == '10' or '9' or '8':
   print('well')
   print('well done')
else if mylist == '7' or'6' or '5' or '4' or '3':
   print('mid') 
   print('moderate') 
else if mylist == '2'   or '1':
   print('weak')
else print('0')  

 File "<ipython-input-42-fc470037cf12>", line 5
    else if mylist == '7' or'6' or '5' or '4' or '3':
         ^
SyntaxError: expected ':'

I change space between : and ' but .... what should Ido?

4
  • 1
    You must be on the tour before asking questions. Commented May 6, 2023 at 20:06
  • 2
    You need to do elif: not else if:. That's just the way python works. Commented May 9, 2023 at 5:35
  • 1
    Does this answer your question? What is the correct syntax for 'else if'? Commented Sep 15, 2023 at 3:44
  • There are many more things wrong with this code besides what is complained about. Commented Sep 15, 2023 at 3:44

1 Answer 1

-1

In Python, there are three forms of the if...else statement :

if statement

if...else statement

if...elif...else statement

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.