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
print("BEFORE") | |
def creer_classes(eleves_tries): | |
taille_classe = len(eleves_tries)//3 | |
return ( eleves_tries[:taille_classe],eleves_tries[taille_classe:2*taille_classe],eleves_tries[2*taille_classe:]) | |
print(creer_classes([])) | |
print(creer_classes([0])) | |
print(creer_classes([0,1,2])) |
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
[<!DOCTYPE html>] | |
[<html>] | |
for item in itemlist: | |
[<li>{item}</li>] | |
[</html>] | |
[<!-- tout ce qui se trouve entre crochet est ajouté au template, le reste s'execute come code executabel standard-->] |
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
from itertools import product | |
dices=[range(1,7),range(1,7),range(1,7),range(1,7),range(1,7)] | |
wins={0:0,1:0,2:0} | |
C = 0 | |
for a,b,c,d,e in product(*dices): | |
n=0; | |
d,e =sorted([d,e]) | |
A,B = sorted([a,b,c],reverse=True)[:2] | |
if A>e: |
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
// Define the two rotations as quaternions | |
Quaternion rotation1 = Quaternion.Euler(x1, y1, z1); // First rotation | |
Quaternion rotation2 = Quaternion.Euler(x2, y2, z2); // Second rotation | |
// Combine the rotations | |
Quaternion combinedRotation = rotation1 * rotation2; | |
// Apply the combined rotation to the object's transform | |
transform.rotation = combinedRotation; |
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
# pseudo code de ton traitement | |
################################ | |
read_record: | |
for line in fichier(): | |
records.append(scanf(line)) | |
partie1: | |
for record in records(): |
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
def main(): | |
from time import time as t | |
t1=t() | |
for i in range(1_000_000_000): |
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
var win=0;for(var i=0;i<10*1000*1000;i++){if(Math.random()*100<=0.01){win++;};};console.log(win/(10*1000*1000)); |
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
from collections import Counter | |
words = "le petit chat est mort le gros chien est rassasié".split() | |
count=Counter(words ) | |
print(count.most_common()) | |
# resultat | |
# [('le', 2), ('est', 2), ('petit', 1), ('chat', 1), ('mort', 1), ('gros', 1), ('chien', 1), ('rassasié', 1)] |
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
#!/bin/bash | |
set -eu | |
echo "Scanning for sqlite databases..." | |
find \ | |
~\ | |
-type f '(' -iname '*.sqlite' -o -iname '*.db' ')' \ | |
-print0 | while read -r -d $'\0' filename; do |
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 | |
import sys | |
def e(arg): | |
return re.escape(arg) | |
def any(arg): | |
return "("+"|".join(map(re.escape,arg.split()))+")" | |
def non_space(): | |
return r"\S+" | |
def spaced(*args): | |
return "\s+".join(args) |
NewerOlder