cs/Practical File/questions/question_09_output.txt
Neil Revin 780baf678e
chore: move question & output files
Move python question files to 'questions' directory
Move output files to 'outputs' directory
Copy output files to 'questions' for ease of viewing

Signed-off-by: Neil <neil@willofsteel.me>
2025-06-24 02:34:07 +05:30

24 lines
414 B
Plaintext

Question 09:
Write a Python program to check if a number is positive, negative, or zero.
Answer:
def main(num: int) -> None:
if num > 0:
print(f"{num} is positive.")
elif num < 0:
print(f"{num} is negative.")
else:
print("The number is zero.")
if __name__ == '__main__':
main(10)
main(-5)
main(0)
Output:
10 is positive.
-5 is negative.
The number is zero.