Skip to content

Commit a6fd8e4

Browse files
✨ std_lib: iterable unpacking
1 parent abdfbac commit a6fd8e4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

standard_lib/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ A collection of useful snippets using only the standard library.
3333
| hash_file | Hash a file using built-in packages |
3434
| hex_decode | Get bytes-like string from hex |
3535
| human_readable_bytecode | Print the bytecode representations in a human readble format |
36+
| iterable_unpacking | Unpack an iterable and assigns its elements to multiple variables |
3637
| keep_metadata_on_decorator_usage | Keep functions metadata after decoration |
3738
| list_unpacking | Unpacking a list using the `*` operator |
3839
| max_int_in_list_of_str | Get the largest number from a list of strings |

standard_lib/iterable_unpacking.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
numbers = [1, 2, 3]
2+
x, y, z = numbers
3+
print(x)
4+
print(y)
5+
print(z)

0 commit comments

Comments
 (0)