From 55c7becd03f828da6fe0d7e3905ca9dc19ef6bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sat, 4 Feb 2023 12:00:13 +0100 Subject: [PATCH] Combinatorics --- README.md | 30 +++++++++++++++--------------- index.html | 34 +++++++++++++++++----------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 0268bda..5b0692e 100644 --- a/README.md +++ b/README.md @@ -558,30 +558,30 @@ import itertools as it ``` ```python ->>> it.product('abc', 'abc') # a b c -[('a', 'a'), ('a', 'b'), ('a', 'c'), # a x x x - ('b', 'a'), ('b', 'b'), ('b', 'c'), # b x x x - ('c', 'a'), ('c', 'b'), ('c', 'c')] # c x x x +>>> it.product('abc', 'abc') # a b c +[('a', 'a'), ('a', 'b'), ('a', 'c'), # a x x x + ('b', 'a'), ('b', 'b'), ('b', 'c'), # b x x x + ('c', 'a'), ('c', 'b'), ('c', 'c')] # c x x x ``` ```python ->>> it.combinations('abc', 2) # a b c -[('a', 'b'), ('a', 'c'), # a . x x - ('b', 'c')] # b . . x +>>> it.combinations('abc', 2) # a b c +[('a', 'b'), ('a', 'c'), # a . x x + ('b', 'c')] # b . . x ``` ```python ->>> it.combinations_with_replacement('abc', 2) # a b c -[('a', 'a'), ('a', 'b'), ('a', 'c'), # a x x x - ('b', 'b'), ('b', 'c'), # b . x x - ('c', 'c')] # c . . x +>>> it.combinations_with_replacement('abc', 2) # a b c +[('a', 'a'), ('a', 'b'), ('a', 'c'), # a x x x + ('b', 'b'), ('b', 'c'), # b . x x + ('c', 'c')] # c . . x ``` ```python ->>> it.permutations('abc', 2) # a b c -[('a', 'b'), ('a', 'c'), # a . x x - ('b', 'a'), ('b', 'c'), # b x . x - ('c', 'a'), ('c', 'b')] # c x x . +>>> it.permutations('abc', 2) # a b c +[('a', 'b'), ('a', 'c'), # a . x x + ('b', 'a'), ('b', 'c'), # b x . x + ('c', 'a'), ('c', 'b')] # c x x . ``` diff --git a/index.html b/index.html index 512b96b..ae3da1e 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@
- +
@@ -500,24 +500,24 @@ Point(x=1, y=2 [(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)] -
>>> it.product('abc', 'abc')                      #   a  b  c
-[('a', 'a'), ('a', 'b'), ('a', 'c'),              # a x  x  x
- ('b', 'a'), ('b', 'b'), ('b', 'c'),              # b x  x  x
- ('c', 'a'), ('c', 'b'), ('c', 'c')]              # c x  x  x
+
>>> it.product('abc', 'abc')                    #   a  b  c
+[('a', 'a'), ('a', 'b'), ('a', 'c'),            # a x  x  x
+ ('b', 'a'), ('b', 'b'), ('b', 'c'),            # b x  x  x
+ ('c', 'a'), ('c', 'b'), ('c', 'c')]            # c x  x  x
 
-
>>> it.combinations('abc', 2)                     #   a  b  c
-[('a', 'b'), ('a', 'c'),                          # a .  x  x
- ('b', 'c')]                                      # b .  .  x
+
>>> it.combinations('abc', 2)                   #   a  b  c
+[('a', 'b'), ('a', 'c'),                        # a .  x  x
+ ('b', 'c')]                                    # b .  .  x
 
-
>>> it.combinations_with_replacement('abc', 2)    #   a  b  c
-[('a', 'a'), ('a', 'b'), ('a', 'c'),              # a x  x  x
- ('b', 'b'), ('b', 'c'),                          # b .  x  x
- ('c', 'c')]                                      # c .  .  x
+
>>> it.combinations_with_replacement('abc', 2)  #   a  b  c
+[('a', 'a'), ('a', 'b'), ('a', 'c'),            # a x  x  x
+ ('b', 'b'), ('b', 'c'),                        # b .  x  x
+ ('c', 'c')]                                    # c .  .  x
 
-
>>> it.permutations('abc', 2)                     #   a  b  c
-[('a', 'b'), ('a', 'c'),                          # a .  x  x
- ('b', 'a'), ('b', 'c'),                          # b x  .  x
- ('c', 'a'), ('c', 'b')]                          # c x  x  .
+
>>> it.permutations('abc', 2)                   #   a  b  c
+[('a', 'b'), ('a', 'c'),                        # a .  x  x
+ ('b', 'a'), ('b', 'c'),                        # b x  .  x
+ ('c', 'a'), ('c', 'b')]                        # c x  x  .
 

#Datetime

  • Module 'datetime' provides 'date' <D>, 'time' <T>, 'datetime' <DT> and 'timedelta' <TD> classes. All are immutable and hashable.
  • @@ -2923,7 +2923,7 @@ $ pyinstaller script.py --add-data '<path>:.'