belongs to collection: Python Tuple Exercises
Write a program to unpack the following tuple into four variables and display each variable.
Given:
tuple1 = (10, 20, 30, 40)
Expected output:
tuple1 = (10, 20, 30, 40) # Your code print(a) # should print 10 print(b) # should print 20 print(c) # should print 30 print(d) # should print 40
Solution:
tuple1 = (10, 20, 30, 40) # unpack tuple into 4 variables a, b, c, d = tuple1 print(a) print(b) print(c) print(d)
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Solution:
need an explanation for this answer? contact us directly to get an explanation for this answer