From 751770ae20b577298f46aa2d821e4479b2d49c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 27 Jun 2019 22:50:46 +0200 Subject: [PATCH] Tuple --- README.md | 8 ++++---- index.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ec39c66..36fa0dd 100644 --- a/README.md +++ b/README.md @@ -128,8 +128,8 @@ Set ``` ### Frozen Set -* **Frozen set is immutable and hashable set.** -* **It can be used as a key in a dictionary or as an element in a set.** +* **Is immutable and hashable.** +* **That means it can be used as a key in a dictionary or as an element in a set.** ```python = frozenset() ``` @@ -137,7 +137,7 @@ Set Tuple ----- -**Tuple is immutable and hashable list.** +**Tuple is an immutable and hashable list.** ```python = () = (, ) @@ -145,7 +145,7 @@ Tuple ``` ### Named Tuple -**Named tuple is tuple's subclass with named elements.** +**Tuple's subclass with named elements.** ```python >>> from collections import namedtuple diff --git a/index.html b/index.html index 954dba5..144bb44 100644 --- a/index.html +++ b/index.html @@ -288,19 +288,19 @@ Counter({'blue': 3

Frozen Set

    -
  • Frozen set is immutable and hashable set.
  • -
  • It can be used as a key in a dictionary or as an element in a set.
  • +
  • Is immutable and hashable.
  • +
  • That means it can be used as a key in a dictionary or as an element in a set.
<frozenset> = frozenset(<collection>)
 

#Tuple

-

Tuple is immutable and hashable list.

+

Tuple is an immutable and hashable list.

<tuple> = ()
 <tuple> = (<el>, )
 <tuple> = (<el_1>, <el_2>, ...)
 

Named Tuple

-

Named tuple is tuple's subclass with named elements.

+

Tuple's subclass with named elements.

>>> from collections import namedtuple
 >>> Point = namedtuple('Point', 'x y')
 >>> p = Point(1, y=2)