Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

turn characters to alpgabetic numper python

text = input()

def encrypt(t):
    chars = list(text)
    allowed_characters = list(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.?!")

    for char in chars:
        for i in allowed_characters:
            if char == i:
                chars[chars.index(char)] = allowed_characters.index(i)
    return chars

print(encrypt(text))
Comment

PREVIOUS NEXT
Code Example
Python :: python generate list 
Python :: python sockets 
Python :: list square python 
Python :: loop through words in a string python 
Python :: delete element list python 
Python :: pands correlation matrix to dataframe 
Python :: insert into string python more than one 
Python :: boto3.resource python 
Python :: tensor.numpy() pytorch gpu 
Python :: python dataclass 
Python :: django reverse function 
Python :: sum with conditional python 
Python :: use django taggit in template 
Python :: negative number factor python 
Python :: install local package python 
Python :: get multiple inputs in python using map 
Python :: planets with python coding 
Python :: plt get colors in range 
Python :: not equal to in django filter 
Python :: how to check for a substring in python 
Python :: connect snowflake with python 
Python :: how to redirect in django 
Python :: month name in python 
Python :: python run batch file 
Python :: normalize numpy array 
Python :: how to make a python file that prints out a random element from a list 
Python :: remove duplicates from tuple python 
Python :: increment python 
Python :: next iteration python 
Python :: sns how to change color if negative or positive 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =