CodeSolved

Solved Programming Questions & Exercises

Detecting the acidity or alkalinity of a substance based on pH

Practice Easy 2514/ Download 27 Views New

Write a program that receives the pH value of a substance and determines whether the substance is acidic, basic or neutral. اگر pH کمتر از 7 باشد، خروجی "اسیدی" خواهد بود؛ اگر برابر 7 باشد، "خنثی" و اگر بیشتر از 7 باشد، "بازی".

1 Answers

def check_ph():
    ph = float(input("Enter pH value: "))
    if ph < 7:
        print("اسیدی")
    elif ph == 7:
        print("خنثی")
    else:
        print("بازی")

check_ph()
Ai Download Python New

Submit answer

Submitting answers is currently unavailable.

×
×
Close