diff --git a/README.md b/README.md index bae4d74..2f49930 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 b99166c..6679748 100644 --- a/index.html +++ b/index.html @@ -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.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.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.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_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  .
 

#Datetime

  • Module 'datetime' provides 'date' <D>, 'time' <T>, 'datetime' <DT> and 'timedelta' <TD> classes. All are immutable and hashable.