From d1df10753079e6df1a4d6cf6e7cbcefdf568c19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 13 Apr 2018 19:17:14 +0200 Subject: [PATCH] Set, dict, random --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 9146592..4a05bef 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,12 @@ Dictionary .update() ``` +```python +>>> a = [(1, 4), (3, 50)] +>>> dict(a) +{1: 4, 3: 50} +``` + ```python collections.defaultdict() # Creates a dictionary with default values. dict(zip(keys, values)) # Initiates a dict from two lists. @@ -59,6 +65,8 @@ Set .union() .intersection() .difference() +.issubset() +..issuperset() ``` ### Frozenset @@ -223,6 +231,7 @@ import random random.random() random.randint(from_inclusive, to_inclusive) random.shuffle() +random.choice() ``` Infinity