Code to Character

Code to Character

Easy Python Data Types 9 views
Explanation Complexity

Problem Statement

Input has one integer code is provided (0 to 127). Output the character using chr().

Input Format

First line: Integer code (0 to 127)

Output Format

Print one character corresponding to the ASCII code

Example

65
A

Constraints

• 0 ≤ code ≤ 127

Concept Explanation

Input:
code = 65

Using chr(65) gives 'A',
which is the character for ASCII code 65.

Step-by-Step Explanation

1.Read integer code.

2.Use chr(code) to convert it to character.

3.Print the character.

Concept Explanation

Input:
code = 65

Using chr(65) gives 'A',
which is the character for ASCII code 65.

Step-by-Step Explanation

1.Read integer code.

2.Use chr(code) to convert it to character.

3.Print the character.

Input / Output Format

Input Format
First line: Integer code (0 to 127)
Output Format
Print one character corresponding to the ASCII code
Constraints
• 0 ≤ code ≤ 127

Examples

Input:
65
Output:
A

Example Solution (Public)

Python
import sysns=sys.stdin.read().strip()nif not s: sys.exit(0)ncode=int(s)nsys.stdout.write(chr(code))

Official Solution Code

import sysns=sys.stdin.read().strip()nif not s: sys.exit(0)ncode=int(s)nsys.stdout.write(chr(code))
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.