Solution :
No of variables should be equal to no of elements in sequence or tuple.
Example :
data = [25,"Satya","G",(8,31,2010)]
age,fname,lname,dob = data
print("My name ",fname+lname," and age ",age," dob ",dob)
age,fname,lname,(month,day,year) = data
print("My name ",fname+lname," and age ",age," and year i born :",year)
No comments:
Post a Comment