'''
Python program to convert true to 1 and false to 0.
'''

x = 'true'
x = int(x == 'true')
print(x)
x = 'abcd'
x = int(x == 'true')
print(x)

'''
Python program to convert true to 1 and false to 0.
'''

x = 'true'
x = int(x == 'true')
print(x)
x = 'abcd'
x = int(x == 'true')
print(x)

Python program to convert true to 1 and false to 0.