Integer Input , Ascii output | SoloLearn: Learn to code for FREE!

+52

Integer Input , Ascii output

You can get an ascii output by entering an integer? For example, input 65 output A.

5/2/2020 6:53:37 PM

Aad Hoogenboom

18 Answers

New Answer

+35

Input 65 is output 6 and 5 ?

+5

print(ord('A')) is used to give an ASCII input and outputs the integer. print(chr(65)) will give you 'A' as output. see this code I recently wrote (line 19 is where I use it): https://code.sololearn.com/c7yupWTWuI5E I am creating a dictionary, but I think it is easy enough to follow as example?

+5

Yes you can get.. n=int(input ("Enter Num:")) print(chr(n))

+5

Yes you input an integer format And print in char format Automatically it's convert in ASCII code

+3

Input 65 is output 6 and 5 ? Aad Hoogenboom For this : n=input("Enter:") for i in n: print(i )

+3

Mirielle[Inactive] unicode 13 is finally ratifide and my phone is too old to update the OS, so I am stuck on 12. square blocks replace all the new emoji. 😣

+2

You can use the builtin chr() method but sometimes, one needs to be careful so unicodeencodeerror won't occur for some characters that has larger bits than the standard utf-8 https://code.sololearn.com/cI08B59wqp75/?ref=app

+2

narayanaprasad this was not an int to string request. this was an chr(int) to ascii request. see: https://www.rapidtables.com/code/text/ascii-table.html

+2

#To get an Ascii output by #Entering an Integer value... #First step:enter the input from the user int_value=int(input("Enter Number:") #Second convert the Integer to #Ascii by using '''chr()''' ascii_conversion=chr(int_value) print(ascii_coversion) ##output= A

+2

int k; char a; for(k=1;k<=255;k++){ char a=k; printf("ascii code of %d is %c",k,a); } SIMILARLY CONVERT IT FOR PYTHON

+2

#include<stdio.h> int main(){ int n; printf("Enter a Integer : "); scanf("%d",&n); printf("%c",n); }

+1

Chr= int( input ()) Print (chr(chr))

+1

#python #one liner #error GOD programz print(chr(int(input())))

+1

We can do it by using char function on input value

+1

ch = int (input ("Enter a ASCII number : ")) print (chr (ch))

0

inp = [65,66,67,68,13,100] out = "" for x in inp: out+=chr(x) print(out) Hope this helped it can handle one or more than one integers giving a meaningful output

0

you can input this: a=chr(int(input())) print(a)