18 Answers
New Answer18 Answers
New AnswerYes you input an integer format And print in char format Automatically it's convert in ASCII code
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?
Input 65 is output 6 and 5 ? Aad Hoogenboom For this : n=input("Enter:") for i in n: print(i )
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. 😣
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
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
#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
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
#include<stdio.h> int main(){ int n; printf("Enter a Integer : "); scanf("%d",&n); printf("%c",n); }
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
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message