Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

charcodeat python

def charcodeat(string,index):
  if isinstance(string,str) and isinstance(index,int):
    return ord(string[index])
  else:
    raise Exception(f"Error: charcodeat takes a str and an int, received {type(string)} and {type(int)}."
 
PREVIOUS NEXT
Tagged: #charcodeat #python
ADD COMMENT
Topic
Name
5+2 =