Program to assign values of tuples to several variables

In this python tuple program, we will assign values of tuples to several variables and print them.

Steps to solve the program
  1. Create a tuple.
  2. Assign values of tuples to several variables by using variable_names=tuple.
  3. Print the variable name and their value.
				
					tup =  (6,7,3)
(a,b,c) = tup
print("a: ",a)
print("b: ",b)
print("c: ",c)
				
			

Output :

				
					a:  6
b:  7
c:  3
				
			

create a tuple and find an element from it by its index no.

add an item to a tuple.

1 thought on “Program to assign values of tuples to several variables”

Leave a Comment