Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

ord python

# The ord() function returns an integer representing the Unicode character.
res = ord('A')
print(res)
# output 65
Comment

ord python3

# ord('a') means 'get unicode of a'
ord('a') = 97

# chr(97) is the reverse, and means 'get ascii of 97'
chr(97) = 'a'

# to get the int val of a single digit represented as a char, do the following:
# ord(single_digit_char) - ord('0') = single_digit_int
ord('5') - ord('0') = 5
ord('3') - ord('0') = 3
Comment

PREVIOUS NEXT
Code Example
Python :: sys.maxsize() in python 
Python :: Solve linear equation with np.linalg.solve 
Python :: python data type conversion 
Python :: python day of the year 
Python :: regular expression syntax python 
Python :: print to screen 
Python :: python bin function without 0b 
Python :: python dataframe contains value 
Python :: python sort 2d list different sort order for different columns 
Python :: enum python string 
Python :: how to change the size of datapoint in plot python 
Python :: item[0]: (i + 1) * 2 for i, item in (sort_loc) 
Python :: Setting up WingIDE to debug Flask projects 
Python :: re module documentation 
Python :: python flask rest api 
Python :: instalar sympy en thonny 
Python :: where to put capybara default wait time 
Python :: get single batch from torch data loader 
Python :: cmake python interpreter 
Python :: how to import a variable from another python file 
Python :: pd df replace 
Python :: form field required in django views 
Python :: join function 
Python :: check file existtnece python 
Python :: python parse /etc/resolv.conf 
Python :: list of list to numpy array 
Python :: gdscript fixed decimal 
Python :: one line if statement python 
Python :: min stack in python 
Python :: validate string using six library python 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =