Python | Decimal logical_xor() method Last Updated : 05 Sep, 2019 Comments Improve Suggest changes Like Article Like Report Decimal#logical_xor() : logical_xor() is a Decimal class method which returns the digit-wise exclusive or of the two Decimal values. Syntax: Decimal.logical_xor() Parameter: Decimal values Return: the digit-wise and of the two (logical) Decimal values. Code #1 : Example for logical_xor() method Python3 # Python Program explaining # logical_xor() method # loading decimal library from decimal import * # Initializing a decimal value a = Decimal('0') b = Decimal('1') # printing Decimal values print ("Decimal value a : ", a) print ("Decimal value b : ", b) # Using Decimal.logical_xor() method print ("\n\nDecimal a with logical_xor() method : ", a.logical_xor(b)) print ("Decimal b with logical_xor() method : ", b.logical_xor(b)) Output : Decimal value a : 0 Decimal value b : 1 Decimal a with logical_xor() method : 1 Decimal b with logical_xor() method : 0 Code #2 : Example for logical_xor() method Python3 # Python Program explaining # logical_xor() method # loading decimal library from decimal import * # Initializing a decimal value a = Decimal('1') b = Decimal('0') # printing Decimal values print ("Decimal value a : ", a) print ("Decimal value b : ", b) # Using Decimal.logical_xor() method print ("\n\nDecimal a with logical_xor() method : ", a.logical_xor(a)) print ("Decimal b with logical_xor() method : ", a.logical_xor(b)) Output : Decimal value a : 1 Decimal value b : 0 Decimal a with logical_xor() method : 0 Decimal b with logical_xor() method : 1 Comment More infoAdvertise with us Next Article Python | Decimal logical_xor() method N noobestars101 Follow Improve Article Tags : Python Practice Tags : python Similar Reads Python | Decimal logical_or() method Decimal#logical_or() : logical_or() is a Decimal class method which returns the digit-wise or of the two Decimal values. Syntax: Decimal.logical_or() Parameter: Decimal values Return: the digit-wise or of the two (logical) of the Decimal values. Code #1 : Example for logical_or() method Python3 # Py 2 min read Python | Decimal logical_and() method Decimal#logical_and() : logical_and() is a Decimal class method which returns the digit-wise and of the two (logical) Decimal values. Syntax: Decimal.logical_and() Parameter: Decimal values Return: the digit-wise and of the two (logical) Decimal values. Code #1 : Example for logical_and() method Pyt 2 min read Python | Decimal logical_invert() method Decimal#logical_invert() : logical_invert() is a Decimal class method which returns the digit-wise inversion of the Decimal values. Syntax: Decimal.logical_invert() Parameter: Decimal values Return: the digit-wise inversion of the Decimal values. Code #1 : Example for logical_invert() method Python3 2 min read Python | Decimal is_zero() method Decimal#is_zero() : is_zero() is a Decimal class method which checks whether the Decimal value is zero value. Syntax: Decimal.is_zero() Parameter: Decimal values Return: true - if the Decimal value is zero value; otherwise false Code #1 : Example for is_zero() method Python3 # Python Program explain 2 min read Python | Decimal is_subnormal() method Decimal#is_subnormal() : is_subnormal() is a Decimal class method which checks whether the Decimal value is subnormal. Syntax: Decimal.is_subnormal() Parameter: Decimal values Return: true - if the Decimal value is subnormal otherwise false Code #1 : Example for is_subnormal() method Python3 # Pytho 2 min read Like