summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLevi Bostian <levi.bostian@gmail.com>2014-10-09 20:06:57 -0500
committerLevi Bostian <levi.bostian@gmail.com>2014-10-09 20:06:57 -0500
commite2b5279510846d841683bcee17642d984f2d87e0 (patch)
tree16b6d3fc6c199e07a30b1bcc83f5d6d830206e31
parentce3fb267f7fc025e4d38556e033dde560da2a193 (diff)
parenta2043f3adbbeaca72c7ef15c4505924903111c5c (diff)
Merge pull request #796 from Oire/python-exp
[python/en] Adding exponentiation operator
-rw-r--r--python.html.markdown4
-rw-r--r--python3.html.markdown4
2 files changed, 8 insertions, 0 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 390c7b76..febfa119 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -3,6 +3,7 @@ language: python
contributors:
- ["Louie Dinh", "http://ldinh.ca"]
- ["Amin Bandali", "http://aminbandali.com"]
+ - ["Andre Polykanine", "https://github.com/Oire"]
filename: learnpython.py
---
@@ -54,6 +55,9 @@ to Python 2.x. Look for another tour of Python 3 soon!
# Modulo operation
7 % 3 # => 1
+# Exponentiation (x to the y'th power)
+2**4 # => 16
+
# Enforce precedence with parentheses
(1 + 3) * 2 # => 8
diff --git a/python3.html.markdown b/python3.html.markdown
index a94f4eae..e478e57f 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -3,6 +3,7 @@ language: python3
contributors:
- ["Louie Dinh", "http://pythonpracticeprojects.com"]
- ["Steven Basart", "http://github.com/xksteven"]
+ - ["Andre Polykanine", "https://github.com/Oire"]
filename: learnpython3.py
---
@@ -50,6 +51,9 @@ Note: This article applies to Python 3 specifically. Check out the other tutoria
# Modulo operation
7 % 3 # => 1
+# Exponentiation (x to the y'th power)
+2**4 # => 16
+
# Enforce precedence with parentheses
(1 + 3) * 2 # => 8