Python tuple program to convert a binary tuple to an integer

In this python tuple program, we will convert a binary tuple to an integer.

Steps to solve the program
				
					tup = (1,0,0)
print("Original tuple is : ",tup) 
result = int("".join(str(val) for val in tup), 2)
print("Decimal number: ",result)
				
			

Output :

				
					Original tuple is :  (1, 0, 0)
Decimal number:  4
				
			

find common elements between two lists of tuples.

count the total number of unique tuples.

Leave a Comment