mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-22 21:52:31 +03:00
[python/en] Adding exponentiation operator
This commit is contained in:
parent
ce3fb267f7
commit
39d8753d52
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user