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
# -*- coding: utf-8 -*- | |
# my first dev with pythonista. A short game for my children | |
from scene import * | |
import time | |
import random | |
import sound | |
# force cpu to play the right move whith 12 pawn left |
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
# -*- coding: utf-8 -*- | |
#exercise from "Learn Python Through Public Data Hacking" see youtube here : http://youtu.be/RrPZza_vZ3w | |
#Travis traveled to Chicago and took the Clark Street #22 bus up to Dave's office. | |
#Problem: He just left his suitcase on the bus! | |
#Your task: Get it back! | |
#Dave's office is located at: | |
# latitude =41.980262 |
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
EX,EY,JX,JY=[int(i) for i in raw_input().split()] | |
#il n'est pas nécessaire de prendre en compte le NORD | |
#Les tests ne prennent jamais en compte cette direction | |
while 1: | |
if EY>JY: | |
if EX>JX:print 'SE';JX+=1;JY+=1 | |
elif EX<JX:print 'SW';JX-=1;JY+=1 | |
else:print 'S';JY+=1 | |
if EY==JY: | |
if EX>JX:print 'E';JX+=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
import sys, math | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
# game loop | |
while 1: | |
SX, SY = [int(i) for i in raw_input().split()] | |
hauteurMontagne = {} | |
for i in xrange(8): | |
MH = int(raw_input()) # represents the height of one mountain, from 9 to 0. Mountain heights are provided from left to right. |
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 sys, math | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
LongueurPontAvantTrou = int(raw_input()) # the length of the road before the gap. | |
LongueurTrou = int(raw_input()) # the length of the gap. | |
LongueurPontApresTrou = int(raw_input()) # the length of the landing platform. | |
# game loop |
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 sys, math | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
N = int(raw_input()) # the number of points used to draw the surface of Mars. | |
for i in xrange(N): | |
# LAND_X: X coordinate of a surface point. (0 to 6999) | |
# LAND_Y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars. | |
LAND_X, LAND_Y = [int(j) for j in raw_input().split()] |
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 sys, math | |
from bisect import bisect_left | |
from bisect import bisect_right | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
N = int(raw_input()) # the number of temperatures to analyse | |
TEMPS = raw_input() # the N temperatures expressed as integers ranging from -273 to 5526 |
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 sys, math, re, string | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
L = int(raw_input()) | |
H = int(raw_input()) | |
T = raw_input() | |
T = T.upper() #on passe le texte en majuscule |
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 sys, math, binascii | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
MESSAGE = raw_input() | |
string ="" | |
result ="" | |
#convertir code ascii en binaire |
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 sys, math,re | |
# Auto-generated code below aims at helping you parse | |
# the standard input according to the problem statement. | |
N = int(raw_input()) # Number of elements which make up the association table. | |
Q = int(raw_input()) # Number Q of file names to be analyzed. | |
d ={} | |
#dico avec extension en cle et le type mime pour valeur |
OlderNewer