Created
April 18, 2014 17:07
-
-
Save samueltcsantos/11054441 to your computer and use it in GitHub Desktop.
Operadores aritméticos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on 18/04/2014 | |
@author: Samuel T. C. Santos | |
Operadores Aritmetico em Python | |
''' | |
a = 4 | |
b = 5 | |
#operadores de soma: + | |
c = a + b | |
# operador de subtracao: - | |
d = c - a | |
#operador de multiplicao: * | |
e = d * b | |
#operador de potenciacao : ** | |
f = a ** 2 | |
#operador de divisao : / | |
g = f / 2 | |
#operador de modulo: % | |
h = 10 % 7 | |
print "a + b = ", c | |
print "c - a = ", d | |
print "d * b = " , e | |
print "a ** 2 = ", f | |
print "f / 2 = ", g | |
print "O resto da divisao de 10 por 7 = ", h | |
''' | |
Saida do Programa: | |
a + b = 9 | |
c - a = 5 | |
d * b = 25 | |
a ** 2 16 | |
f / 2 8 | |
O resto da divisao de 10 por 7 = 3 | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment