muse
0
Q:

ord in python

if x==1 or y==1:
  print(x,y)
9
# The ord() function returns an integer representing the Unicode character.
res = ord('A')
print(res)
# output 65
5
# inbuilt function return an  
# integer representing the Unicode code 
value = ord("A") 
  
# writing in ' ' gives the same result 
value1 = ord('A') 
  
# prints the unicode value 
print value, value1 
1
x = 1
y = 10

if x%2 == 0 or y%2 == 0:
  print(x%2)
  
#Output#
#1
6
# Syntax for Boolean expression with or in Python
exp1 or exp2
6
#Given a string of length one, return an integer 
#representing the Unicode code point of the character when the 
#argument is a unicode object, or the value of the byte when 
#the argument is an 8-bit string.
#Ex.
  Input : a
  Output : 97
4

New to Communities?

Join the community