Python/Basic Code
From r00tedvw.com wiki
(Difference between revisions)
Line 2: | Line 2: | ||
:variables can be integers, floats, or boolean. Integers are whole numbers, floats are numbers with remainders, boolean is either True of False. | :variables can be integers, floats, or boolean. Integers are whole numbers, floats are numbers with remainders, boolean is either True of False. | ||
variable=integer | variable=integer | ||
+ | ;arithmetic operators | ||
+ | :add/subtract/multiply/divide/exponentiation/modulo | ||
+ | :exponentiation (exponential, similar to square roots) | ||
+ | 2 ** 3=8 (2*2*2) | ||
+ | :modulo (remainder) | ||
+ | 5 % 2=1 (5/2 = 2 with a remainder of 1) | ||
;comments | ;comments | ||
:<nowiki>#</nowiki> for single like quote or """ quote """ for multi line quote | :<nowiki>#</nowiki> for single like quote or """ quote """ for multi line quote |
Revision as of 23:17, 21 March 2013
- variables
- variables can be integers, floats, or boolean. Integers are whole numbers, floats are numbers with remainders, boolean is either True of False.
variable=integer
- arithmetic operators
- add/subtract/multiply/divide/exponentiation/modulo
- exponentiation (exponential, similar to square roots)
2 ** 3=8 (2*2*2)
- modulo (remainder)
5 % 2=1 (5/2 = 2 with a remainder of 1)
- comments
- # for single like quote or """ quote """ for multi line quote
#quote """quote quote"""
- display output
print "Hello World"