Skip to content

Commit 7261334

Browse files
Add function to convert ASCII to character
1 parent c79034c commit 7261334

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

conversions/ascii_to_char.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def ascii_to_char(ascii_val: int) -> str:
2+
"""Convert ASCII value to corresponding character."""
3+
return chr(ascii_val)
4+
5+
if __name__ == "__main__":
6+
num = int(input("Enter ASCII value: "))
7+
print("Character is:", ascii_to_char(num))

0 commit comments

Comments
 (0)