From 72613341c8dd6f2d7ac6c2ea2881fcfaed5c67d7 Mon Sep 17 00:00:00 2001 From: SIDDHESH SADARAO <137042983+siddheshsadarao@users.noreply.github.com> Date: Sun, 19 Oct 2025 23:27:06 +0530 Subject: [PATCH] Add function to convert ASCII to character --- conversions/ascii_to_char.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 conversions/ascii_to_char.py diff --git a/conversions/ascii_to_char.py b/conversions/ascii_to_char.py new file mode 100644 index 000000000000..04822b5c3ba4 --- /dev/null +++ b/conversions/ascii_to_char.py @@ -0,0 +1,7 @@ +def ascii_to_char(ascii_val: int) -> str: + """Convert ASCII value to corresponding character.""" + return chr(ascii_val) + +if __name__ == "__main__": + num = int(input("Enter ASCII value: ")) + print("Character is:", ascii_to_char(num))