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
for p in ['Terra','Marte', 'Jupiter']: | |
print("Hello {0}".format(planeta)) |
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
import time | |
def ligarChurrasqueira(Tfinal): | |
T = 0 | |
print("Iniciando o aquecimento") | |
for i in range(0,Tfinal+1,10): | |
print('{0} graus'.format(i)) | |
time.sleep(1) | |
if i > Tfinal: | |
print("Churrasqueira aquecida à {0}".format(Tfinal)) |
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
while True: | |
input1 = input("Você é uma pessoa organizada? (s/n)") | |
if input1 == 's': | |
print("Eu acho que você está mentindo") | |
elif input1 == 'n': | |
print("Você precisa aproveitar melhor seu tempo") | |
else: | |
print("Digite s ou n") | |
print("Vamos brincar com listas?") | |
frase=str(input("Digite uma frase qualquer")) |
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
import socket | |
HOST, PORT = '', 8888 | |
listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
listen_socket.bind((HOST, PORT)) | |
listen_socket.listen(1) | |
print 'Serving HTTP on port %s ...' % PORT | |
while True: |
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
import re | |
p = re.compile('\d') | |
m = p.match("amor123love") | |
print(m.group()) |
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
import re | |
p = re.compile('a') | |
m = p.match("amor") | |
print(m.group()) |
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
import re | |
p = re.compile('m') | |
m = re.findall(p,"ammor") #amor com 2 emes | |
print(m) |
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
import re | |
p = re.compile('\d') | |
m = re.findall(p,"am2mor57") | |
print(m) |
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
import re | |
p = re.compile('\(.+\)') | |
m = re.findall(p,"aldk(13432*76)adsjf") | |
print(m) |