Number to Letter - Python


#1

I am just trying to get the input number to give me the corresponding letter out but I am not getting anything. Here is what I have right now. I am sure this is something little, but I can’t see it.

Num to Letter


#2

Assuming that you want your script to return “a” for an input of 1, when using the ord() function, you will need to add 96 to your input value (97 = "“a”, 98 = “b” etc.).

Alternatively, you may just want to use Character.FromNumber from package Clockwork and be done with it… :wink:


#3

ToAlphaAndreas,

Thanks for the reply and sorry to the delay in response. I am not sure what wasn’t working the first time, but here is the working code. I have also published this as Number.ToAlpha in the package manager. It doesn’t extend past Z for me, but was simpler in my mind and also works from 0 to 25 not 1 to 26. Thank you!