Skip to content

Instantly share code, notes, and snippets.

@hassanuos
Created January 31, 2024 05:05
Show Gist options
  • Save hassanuos/1c3df5b9cc87f9f1d60fa6d8cca081db to your computer and use it in GitHub Desktop.
Save hassanuos/1c3df5b9cc87f9f1d60fa6d8cca081db to your computer and use it in GitHub Desktop.
#packing
*persons, = "hassan", "raza", "dev"
print(persons)
#output
# ["hassan", "raza", "dev"]
#unpack
x, *y = persons
print(x) #hassan
c, *d = y
print(c) #raza
print(d) #["dev"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment