IndentationError expected an indented block in phyton

0 votes
Hi I i keep getting that error and I looked everything is right. I google the error it says i am missing a colon after each function but i do have that.

def pH2Category(pH):
    if " pH out of range":

    elif pH<0: and pH<=2:
        category = "Strongly acidic"
    elif pH<=3 and pH<=5:
        category = "Weakly acidic"
    elif pH<=6 and pH<=8:
        category = "Neutral"
    elif pH<=9 and pH<=12:
        category = "Weaklyly basic"
     elif pH=<12 and pH=14:
        category = "Strongly basic"
     else :
        category = "pH out of range"
        
    return category
Sep 30, 2021 in Python by anonymous
• 120 points
358 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

+2 votes
9 answers

Python error "IndentationError: expected an indented block"

Python requires its code to be indented ...READ MORE

answered Jun 17, 2019 in Python by Varun

edited Jun 17, 2019 324,178 views
0 votes
1 answer

I was written the python program, am getting error message "IndentationError: expected an indented block"

Hi@Thiyagarajan, You have one else block in your ...READ MORE

answered May 27, 2020 in Python by MD
• 95,460 points
3,552 views
0 votes
1 answer

IndentationError: expected an indented block

Hello @ nishit, Indentation means the space from margin to ...READ MORE

answered Aug 10, 2020 in Python by Niroj
• 82,840 points
5,770 views
0 votes
1 answer

IndentationError: expected an indented block

Hi, @Baker, Putting in extra space or leaving ...READ MORE

answered Oct 19, 2020 in Python by Gitika
• 65,770 points
1,214 views
0 votes
1 answer

I got expected an indented block error.

Hi, You used one function in your code, ...READ MORE

answered Jun 16, 2020 in Python by MD
• 95,460 points
2,509 views
0 votes
1 answer

I've been trying to run this code, but the error says "Expected an indented block" for the line, " word_as_list[index] = guess."

Hi, @Paradox, The error message IndentationError: expected an indented ...READ MORE

answered Nov 21, 2020 in Python by anonymous
• 65,770 points
1,080 views
0 votes
1 answer

How can I raise an exception in Python so that it can later be caught via an except block?

It's pretty simple to raise a query  raise ...READ MORE

answered May 29, 2019 in Python by Umesh
961 views
+2 votes
3 answers

How can I play an audio file in the background using Python?

down voteacceptedFor windows: you could use  winsound.SND_ASYNC to play them ...READ MORE

answered Apr 4, 2018 in Python by charlie_brown
• 7,720 points
13,544 views
+4 votes
7 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP