← come back | Golfdocs - Pyth

+ - plus - addition

Definition 1

Addition of two numbers. + in Python.[1]

Definition 2

Concatenation of two strings. + in Python.[1]

Definition 3

Concatenation of two lists. + in Python, however, cast to list.[1]

Definition 4

Append anything to the end of a list.[1]

Definition 5

Prepend anything to the beginning of a list.[1]

Definition 6

Append a number, cast to string, to the end of a string.[1]

Definition 7

Prepend a number, cast to string, to the beginning of a string.[1]

Definition 8

Union of a set and a collection (any of string, list, set or dictionary).[1]

Definition 9

Union of a set and anything, enclosed in a set.[1]

Synopsis

+<left side addend><right side addend>
Where <left side addend> and <right side addend> depend on the definition.

Examples

+2 2
+"Hello, ""World!
+,1 2,3 4
Try it online! Result:
4
Try it online! Result:
Hello, World!
Try it online! Result:
[1, 2, 3, 4]
+,1 2 3 +0,1 2 +"#"1
Try it online! Result:
[1, 2, 3]
Try it online! Result:
[0, 1, 2]
Try it online! Result:
#1
+1"$
+.{1.{2
+.{1 2
Try it online! Result:
1$
Try it online! Result:
{1, 2}
Try it online! Result:
{1, 2}

References

  1. pyth.herokuapp.com/rev-doc.txt

Fork this collection on GitHub! o/