+ 1
Is possible to build variables moving from numbers to letters?(using python)
variables
14 odpowiedzi
+ 12
Actually, the chr() method kinda does exactly that ;)
+ 12
>>> print(chr(65))
'A'
Is that what you mean?
+ 11
Sorry for being maybe too far away. Maybe I understood your question wrong. Is that what you were looking for, to convert a number into its ASCII representation?
I just don't really know what you mean by "moving from numbers to letters"... 🤷
+ 5
@Gianluca, if "moving from number to letter" means to get a character given a number, then the chr() function returns a character that represents the number passed in as its argument. As @Kuba explained, the number that represents the letter 'A' is 65, you can lookup ASCII table for more info.
Try this for example:
chars = [65,66,67,68,69]
for c in chars:
print (chr(int(c)))
Just an example, sorry if it's incorrect :)
+ 4
What do you mean by "moving from numbers to letters"? I can't understand, a little more detail, or example would be nice :)
+ 3
thank you for everything. I am going to.see the ASCII TAble
+ 3
Ipang and kuba
+ 3
The word "moving" causes confusion. Try "converting'
+ 3
@Gianluca, if you can explain a little more about what you're looking for then people here will be glad to help, but if you wish to seek answers on your own you too have the freedom of choice. Welcome to SoloLearn :)
+ 2
I have studied the basic concepts.Is the "chr()" method far from me now?
+ 2
you said me that the chr() method kinda does want i wanted to do .So I asked you if,being at my level,i am far from that knowledge. Now you wrote me >>> print(chr(65))
'A'
and i do not know what it means because this is my first day
+ 1
how much far?
+ 1
kuba I was not looking for that.So now I am going to look what I was looking for by my self.Thank you guys🙂
+ 1
thank you😊