在线编译器 Python

Ph = int(input("Digite un nunero entre (0-14:)")) if Ph > 7 print("basico") elif Ph < 7 print("Acido") else: print("Neutro")
This code asks the user for a pH value and tries to classify it as basic, acidic, or neutral using if, elif, and else.

- Check the lines with if and elif: in Python, a condition must end with a colon, so look at what is missing after `if Ph > 7` and `elif Ph < 7`.
- Also check the indentation of the print statements inside each branch, since Python relies on consistent indentation to know which lines belong to which condition.