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 in Python by anonymous
• 120 points
2 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

0 votes
3 answers

Python error "IndentationError: expected an indented block"

IndentationError:  what is the mean READ MORE

answered Oct 14, 2020 in Python by anonymous
• 140 points
177,140 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,300 points
2,318 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,880 points
3,391 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,970 points
268 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,300 points
1,307 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,970 points
248 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
264 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,780 points
9,815 views
+4 votes
7 answers