Python Tuple Unpacking Presentation


This is the presentation associated with the python Tuple Unpacking video.

[dflip id=”3629″ ][/dflip]

Download Presentation

Python Tuple Unpacking Video Question

This is the question that was asked in the python tuple unpacking video:

Question:

Write the code to produce the desired output:

names = ("Bill", "Steve","Tim", "John")

Desired Output:

firstname = Bill
lastname = John
Others = ['Steve', 'Tim']

[bg_collapse view=”button-blue” color=”#ffffff” icon=”eye” expand_text=”Show Answer” collapse_text=”Hide Answer” ]

In [1]:
names = ("Bill", "Steve","Tim", "John")
firstname, lastname, *Others = names

print("firstname =",firstname)
print("lastname =",lastname)
print("Others =",Others)
firstname = Bill
lastname = Steve
Others = ['Tim', 'John']

[/bg_collapse]


dinamobet - dinamobet giriş - dinamobet güncel giriş
dinamobet
dinamobet - dinamobet giriş - dinamobet güncel giriş
dinamobet
dinamobet
dinamobet
Dinamobet
betasus
meritking
dinamobet
dinamobet
dinamobet
dinamobet
dinamobet
dinamobet
dinamobet
Dinamobet
Dinamobet
Dinamobet
Dinamobet
Dinamobet
Dinamobet
Kulisbet
Kulisbet
Dinamobet
Dinamobet
Kulisbet
Kulisbet
Kulisbet giriş
Kulisbet güncel giriş