This file contains hidden or 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 random | |
girls = '''Júlia Sophia Isabella Manuela Giovanna Alice Laura | |
Luiza Beatriz Mariana Yasmin Gabriela Rafaela Isabelle Lara | |
Letícia Valentina Nicole Sarah Vitória Isadora Lívia Helena | |
Lorena Clara Larissa Emanuelly Heloisa Marina Melissa Gabrielly | |
Eduarda Rebeca Amanda Alícia Bianca Lavínia Fernanda Ester | |
Carolina Emily Cecília Pietra Milena Marcela Laís Natália | |
Maria Bruna Camila Luana Catarina Olivia Agatha Mirella | |
Sophie Stella Stefany Isabel Kamilly Elisa Luna Eloá Joana | |
Mariane Bárbara Juliana Rayssa Alana Caroline Brenda Evelyn |
This file contains hidden or 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
g = {} | |
g[1] = [2, 3, 5] | |
g[2] = [1, 6, 4] | |
g[3] = [1, 4, 7] | |
g[4] = [2, 3, 8] | |
g[5] = [1, 6, 7] | |
g[6] = [2, 5, 8] | |
g[7] = [3, 5, 8] | |
g[8] = [4, 6, 7] | |
removidos = [True] + 8 * [False] |
This file contains hidden or 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 requests | |
import json | |
AFTER = 1353233754 | |
TOKEN = ' <insert token here> ' | |
#by Akshit Khurana | |
def get_posts(): | |
"""Returns dictionary of id, first names of people who posted on my wall | |
between start and end time""" | |
query = ("SELECT post_id, actor_id, message FROM stream WHERE " |
This file contains hidden or 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
from tkinter import * | |
from sound_panel import * | |
import pygame.mixer | |
import os | |
app=Tk() | |
app.title('Head First Mix') | |
mixer = pygame.mixer | |
mixer.pre_init(buffer = 300) | |
mixer.init() |
This file contains hidden or 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
from tkinter import * | |
import pygame.mixer | |
class SoundPanel(Frame): | |
def track_toggle(self): | |
if self.track_playing.get() == 1: | |
self.track.play(loops = -1) | |
else: | |
self.track.stop() | |
def change_volume(self, v): |
This file contains hidden or 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
def pi_digits(n): | |
k, a, b, a1, b1 = 2, 4, 1, 12, 4 | |
while n > 0: | |
p, q, k = k*k, 2*k+1, k+1 | |
a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1 | |
d, d1 = a/b, a1/b1 | |
while d == d1: | |
yield int(d) | |
n -= 1 | |
a, a1 = 10*(a%b), 10*(a1%b1) |
This file contains hidden or 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
from functools import wraps | |
def hitchhiker(func): | |
@wraps(func) | |
def wrapper(*args, **kwargs): | |
return 42 | |
return wrapper | |
@hitchhiker | |
def fat(n): | |
if n < 2: return 1 |
This file contains hidden or 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
#conteúdo do texto abaixo original de http://afterfest.com.br/fotos/XV-Edicao | |
texto = ''' | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Fotos BIXURRASCO - XV Edicao - FATEC - 14/09/2013 - Afterfest</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta content="all" name="robots" /> |
This file contains hidden or 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
# program template for Spaceship | |
import simplegui | |
import math | |
import random | |
# globals for user interface | |
WIDTH = 800 | |
HEIGHT = 600 | |
score = 0 | |
lives = 3 |
This file contains hidden or 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
from random import randint | |
print ('Bem vindo!') | |
sorteado = randint(1, 100) | |
chute = 0 | |
while chute != sorteado: | |
chute = int(input ('Chute: ')) | |
if chute == sorteado: | |
print ('Você venceu!') | |
else: | |
if chute > sorteado: |