cs/Practical File/question_13_output.txt
Neil Revin cc8b0efe94
feat: add practical file projects
Signed-off-by: Neil <neil@willofsteel.me>
2025-06-24 02:28:22 +05:30

19 lines
375 B
Plaintext

Question 13:
Write a Python program to find the absolute value of a number.
Answer:
def main(num: float) -> None:
abs_value = abs(num)
print(f"The absolute value of {num} is {abs_value}")
if __name__ == '__main__':
main(-5.5)
main(3.14)
main(0)
Output:
The absolute value of -5.5 is 5.5
The absolute value of 3.14 is 3.14
The absolute value of 0 is 0