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
# .*. coding: latin1 .*. | |
# importa wxPythton | |
import sqlite3 | |
con = sqlite3.connect('aula3228524.db') | |
cur = con.cursor() | |
sql = 'create table imc (id integer primary key, peso float, altura float, imc float)' | |
cur.execute(sql) |
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
#!/usr/bin/python | |
# -*- coding: latin1 -*- | |
print ("primo 1") | |
for i in range (2,101): | |
x = 0; | |
for j in range (1,101): | |
if i % j == 0: | |
x+=1 | |
if x == 2: | |
print ("primo", i) |
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
#!/usr/bin/python | |
# -*- coding: latin1 -*- | |
a = input ("insira o valor A "); | |
b = input ("insira o valor B "); | |
c = input ("insira o valor C "); | |
if (a < (b + c)): | |
print "e um triangulo" | |
else: |
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
#!/usr/bin/python | |
# -*- coding: latin1 -*- | |
a = input ("insira o valor A "); | |
b = input ("insira o valor B "); | |
c = input ("insira o valor C "); | |
if (a<b and a<c): | |
print "menor",a |
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
#!/usr/bin/python | |
# -*- coding: latin1 -*- | |
def inverter (frase): | |
print "A frase e: ",frase[::-1] | |
inverter("o rato roeu a roupa") |