adambard / adambard/learnxinyminutes-docs

unpacking list in python

Open
#4,610 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Markdown
Stars
12.3k
Forks
3.7k
Avg merge
13h 10m
Merged PRs (30d)
6

Description

## we can unpack the list in python
``` python:
a = [1,2,3,4,5]
a,*b,c = a
print(a)
print(b)
print(c)
```
answer: ```a = 1, b = 2,3,4 ,c = 5 ```

not only unpack tuples we can unpack **lists**.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.