Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Convert Letters to Numbers in Python

Convert Letters to Numbers in Python using ord() method
text= "itsmycode"
num_list = []

# iterate each characters in string
# and convert to number using ord()
for c in text:
   num_list.append(ord(c) - 96)

# print the converted letters as numbers in list
print("After converting letters to numbers",num_list)
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #Convert #Letters #Numbers #Python
ADD COMMENT
Topic
Name
7+4 =