到目前为止,我已经能够拿一个字母,并找到它的数字位置。例如,a == 0
但现在我想取这个数字,然后加4.然后返回该数字的字母表。 因此, a == 0; 0 + 4 = 5;
应返回f
。因为这是字母表中的第五位! 这里是我到目前为止的代码:如何获取一个数字并找到它的字母位置python
def convert_int(str):
a = string.lowercase.index(str)
addition = a +13
return addition;
'string.lowercase [NEW_INDEX]' –
你的意思是'一个= 1',因为'F = 5 '?或者你想从0开始,所以'f = 4'? – ASCIIThenANSI