QCM C1
This commit is contained in:
parent
3ad9ff1140
commit
eb3c7313c5
199 changed files with 10833 additions and 0 deletions
9
C2/codes/q100_86.py
Normal file
9
C2/codes/q100_86.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
def maxi(t):
|
||||
m = t[0]
|
||||
for x in t:
|
||||
if x[1] >= m[1]:
|
||||
m = x
|
||||
return m
|
||||
|
||||
L = [('Alice', 17), ('Barnabé', 17),('Casimir', 17),
|
||||
('Doriane', 17),('Emilien', 14), ('Fabienne', 16)]
|
||||
3
C2/codes/q101_87.py
Normal file
3
C2/codes/q101_87.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
course = [(5,['Mistral','Lille']),
|
||||
(3,['Zéphir','Paris']),(7,['Ouragan','Bordeaux']),
|
||||
......, ....... ]
|
||||
9
C2/codes/q102_88.py
Normal file
9
C2/codes/q102_88.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
t1 = [['Valenciennes', 24],['Lille', 23],['Laon',
|
||||
31],['Arras', 18]]
|
||||
t2 = [['Lille', 62],['Arras', 53],['Valenciennes',
|
||||
67],['Laon', 48]]
|
||||
|
||||
for i in range(len(t1)):
|
||||
for v in t2:
|
||||
if v[0] == t1[i][0]:
|
||||
t1[i].append(v[1])
|
||||
6
C2/codes/q103_89.py
Normal file
6
C2/codes/q103_89.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def extreme(t, test):
|
||||
m = t[0]
|
||||
for x in t:
|
||||
if test(x,m):
|
||||
m = x
|
||||
return m
|
||||
2
C2/codes/q103_90.py
Normal file
2
C2/codes/q103_90.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
L = [('Alice', 17), ('Barnabé', 18),('Casimir', 17),
|
||||
('Doriane', 20),('Emilien', 15), ('Fabienne', 16)]
|
||||
2
C2/codes/q104_95.py
Normal file
2
C2/codes/q104_95.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
clients = [("Dupont", "Paul", 1),("Durand", "Jacques",
|
||||
2),("Dutronc", "Jean", 3),...]
|
||||
4
C2/codes/q104_96.py
Normal file
4
C2/codes/q104_96.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
x = []
|
||||
for i in range(len(clients)):
|
||||
if clients[i][1] == "Jean":
|
||||
x = clients[i]
|
||||
6
C2/codes/q105_97.py
Normal file
6
C2/codes/q105_97.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
t = [[3,4,5,1],[33,6,1,2]]
|
||||
x = t[0][0]
|
||||
for i in range(len(t)):
|
||||
for j in range(len(t[i])):
|
||||
if x < t[i][j]:
|
||||
x = t[i][j]
|
||||
4
C2/codes/q106_98.py
Normal file
4
C2/codes/q106_98.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
table = [12, 43, 6, 22, 37]
|
||||
for i in range(len(table) - 1):
|
||||
if table[i] > table[i+1]:
|
||||
table[i],table[i+1] = table[i+1], table[i]
|
||||
1
C2/codes/q109_99.py
Normal file
1
C2/codes/q109_99.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
x = [ "x1", "x2", "x3" ]
|
||||
6
C2/codes/q11_8.py
Normal file
6
C2/codes/q11_8.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# n et p sont initialisés dans les lignes précédentes
|
||||
|
||||
t = [ [ 0 for j in range(p) ] for i in range(n) ]
|
||||
|
||||
for k in range(n*p):
|
||||
t[k%n][k%p] = k
|
||||
5
C2/codes/q13_9.py
Normal file
5
C2/codes/q13_9.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
A = [ [1,2,3], [4,5,6], [7,8,9] ]
|
||||
B = [ [0,0,0], [0,0,0], [0,0,0] ]
|
||||
for i in range(3):
|
||||
for j in range(3):
|
||||
B[i][j] = A[j][i]
|
||||
3
C2/codes/q14_10.py
Normal file
3
C2/codes/q14_10.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
alphabet = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
|
||||
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
|
||||
'U', 'V', 'W', 'X', 'Y', 'Z' ]
|
||||
2
C2/codes/q16_11.py
Normal file
2
C2/codes/q16_11.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
t = [0, 3, 5, 7, 9]
|
||||
t[9] = 3 + t[5]
|
||||
1
C2/codes/q17_12.py
Normal file
1
C2/codes/q17_12.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
resultat = [ i*2 for i in range(10) ]
|
||||
5
C2/codes/q18_13.py
Normal file
5
C2/codes/q18_13.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def somme(tab):
|
||||
s = 0
|
||||
for i in range(len(tab)):
|
||||
......
|
||||
return s
|
||||
6
C2/codes/q19_14.py
Normal file
6
C2/codes/q19_14.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
m = []
|
||||
for i in range(5):
|
||||
n = []
|
||||
for j in range(3):
|
||||
n.append(i*j)
|
||||
m.append(n)
|
||||
3
C2/codes/q1_1.py
Normal file
3
C2/codes/q1_1.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
n = 5
|
||||
p = 3
|
||||
t = [ [ …… for j in range(p) ] for i in range(n) ]
|
||||
4
C2/codes/q20_15.py
Normal file
4
C2/codes/q20_15.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
def feed(t):
|
||||
for i in range(len(t)):
|
||||
t[i] = 0
|
||||
return t
|
||||
6
C2/codes/q21_16.py
Normal file
6
C2/codes/q21_16.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def f(L):
|
||||
m = L[0]
|
||||
for x in L:
|
||||
if x > m:
|
||||
m = x
|
||||
return m
|
||||
2
C2/codes/q22_17.py
Normal file
2
C2/codes/q22_17.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
t = [1, 6, 8, 3, 21]
|
||||
u = [x for x in t if x > 3]
|
||||
2
C2/codes/q23_18.py
Normal file
2
C2/codes/q23_18.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
t = [1,2,3,4,5,6,7,8,9]
|
||||
v = [c for c in t if c%3 == 0]
|
||||
8
C2/codes/q28_19.py
Normal file
8
C2/codes/q28_19.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
def construitTable(L,C):
|
||||
t = []
|
||||
for i in range(L):
|
||||
ligne = []
|
||||
for j in range(C):
|
||||
......
|
||||
t.append(ligne)
|
||||
return t
|
||||
4
C2/codes/q29_20.py
Normal file
4
C2/codes/q29_20.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
def f(n1,n2):
|
||||
etendue = max(n1,n2)-min(n1,n2)
|
||||
moyenne = (n1+n2)/2
|
||||
return etendue,moyenne
|
||||
2
C2/codes/q2_2.py
Normal file
2
C2/codes/q2_2.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
t = [2, 8, 9, 2]
|
||||
t[2] = t[2] + 5
|
||||
5
C2/codes/q33_21.py
Normal file
5
C2/codes/q33_21.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
G =[[0, 0, 0, …, 0],
|
||||
[0, 0, 0, …, 0],
|
||||
[0, 0, 0, …, 0]
|
||||
….
|
||||
[0, 0, 0, …, 0]]
|
||||
2
C2/codes/q35_22.py
Normal file
2
C2/codes/q35_22.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
tab = [ ('Léa', 14), ('Guillaume', 12), ('Anthony', 16),
|
||||
('Anne', 15) ]
|
||||
1
C2/codes/q37_23.py
Normal file
1
C2/codes/q37_23.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
t = [ [1,2,3,4], [5,6,7,8], [9,10,11,12] ]
|
||||
9
C2/codes/q3_3.py
Normal file
9
C2/codes/q3_3.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
annee2019 = [('janvier',6), ('février',6), ('mars',12),
|
||||
('avril',20), ('mai',23), ('juin',25),
|
||||
('juillet',29), ('août',25), ('septembre',22),
|
||||
('octobre',15), ('novembre',11), ('décembre',7)]
|
||||
|
||||
m = annee2019[0][1]
|
||||
for mois in annee2019:
|
||||
if (m > mois[1]):
|
||||
m = mois[1]
|
||||
2
C2/codes/q42_24.py
Normal file
2
C2/codes/q42_24.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
T = [[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15],
|
||||
[16,17,18,19,20]].
|
||||
1
C2/codes/q44_25.py
Normal file
1
C2/codes/q44_25.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
[[0,0,0,0], [1,1,1,1], [2,2,2,2]]
|
||||
2
C2/codes/q45_26.py
Normal file
2
C2/codes/q45_26.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
notes = [('Toto', 20), ('John', 12), ('Johnny', 2),
|
||||
('Superman', 16)]
|
||||
1
C2/codes/q47_27.py
Normal file
1
C2/codes/q47_27.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
M = [ [i*j for j in range(4)] for i in range(4) ]
|
||||
3
C2/codes/q49_28.py
Normal file
3
C2/codes/q49_28.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
tab=[['A', 'B', 'C', 'D'],
|
||||
['E', 'F', 'G', 'H'],
|
||||
['I', 'J', 'K', 'L'] ]
|
||||
3
C2/codes/q49_29.py
Normal file
3
C2/codes/q49_29.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# à la fin, on a l'égalité :
|
||||
L == [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
|
||||
'K', 'L' ]
|
||||
8
C2/codes/q52_34.py
Normal file
8
C2/codes/q52_34.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
def divEuclid(n,d):
|
||||
'''renvoie le couple formé du quotient et du reste dans la
|
||||
division de n par d'''
|
||||
q = 0
|
||||
while n-d > 0:
|
||||
q = q + 1
|
||||
n = n - d
|
||||
.......
|
||||
1
C2/codes/q52_35.py
Normal file
1
C2/codes/q52_35.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
(quotient,reste) = divEuclid(15,6)
|
||||
2
C2/codes/q55_36.py
Normal file
2
C2/codes/q55_36.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
tableau = [5,8,6,9]
|
||||
a = tableau[2]
|
||||
4
C2/codes/q59_37.py
Normal file
4
C2/codes/q59_37.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
res = [ [1,2,3], [4,5,6], [7,8,9] ]
|
||||
S = 0
|
||||
for i in range(3):
|
||||
S = S + res[i][2]
|
||||
2
C2/codes/q5_4.py
Normal file
2
C2/codes/q5_4.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
t = (10,6,1,12,15)
|
||||
r = t[3] - t[1]
|
||||
3
C2/codes/q60_38.py
Normal file
3
C2/codes/q60_38.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
echiquier = [ [ 0 for i in range(8) ] for j in range(8) ]
|
||||
echiquier[2][0] = 1
|
||||
echiquier[3][1] = 1
|
||||
1
C2/codes/q61_43.py
Normal file
1
C2/codes/q61_43.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
L = [6, 2, 8, 24, 3, 6, 7, 8]
|
||||
3
C2/codes/q61_44.py
Normal file
3
C2/codes/q61_44.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
p = 8
|
||||
M = [x for x in L if x<p] + [x for x in L if x==p] + [x for
|
||||
x in L if x>p]
|
||||
5
C2/codes/q62_45.py
Normal file
5
C2/codes/q62_45.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def f(L):
|
||||
U = []
|
||||
for i in L:
|
||||
U.append(i**2 - 1)
|
||||
return U
|
||||
1
C2/codes/q64_46.py
Normal file
1
C2/codes/q64_46.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
tableau = [[1,2],[3,4],[5,6]]
|
||||
1
C2/codes/q66_47.py
Normal file
1
C2/codes/q66_47.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
tableau = [ [i+2*j for j in range(4)] for i in range(4)]
|
||||
4
C2/codes/q70_52.py
Normal file
4
C2/codes/q70_52.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
def f(L):
|
||||
return [x*x for x in L if x%2 == 1]
|
||||
|
||||
carre = f([0,1,2,3,4,5,6,7,8,9])
|
||||
1
C2/codes/q71_53.py
Normal file
1
C2/codes/q71_53.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
t = [ x for x in range(2,12) if x % 2 == 1 ]
|
||||
1
C2/codes/q72_54.py
Normal file
1
C2/codes/q72_54.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
L = [['a','b','c'],['bonjour','hello']]
|
||||
3
C2/codes/q73_55.py
Normal file
3
C2/codes/q73_55.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for i in range(n):
|
||||
for j in range(n):
|
||||
......
|
||||
2
C2/codes/q75_56.py
Normal file
2
C2/codes/q75_56.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
L = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
|
||||
'K', 'L' ]
|
||||
4
C2/codes/q75_57.py
Normal file
4
C2/codes/q75_57.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# à la fin, on a l'égalité :
|
||||
tab == [['A', 'B', 'C', 'D'],
|
||||
['E', 'F', 'G', 'H'],
|
||||
['I', 'J', 'K', 'L'] ]
|
||||
4
C2/codes/q76_62.py
Normal file
4
C2/codes/q76_62.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
T = [[12,13,14,15],
|
||||
[24,25,26,27],
|
||||
[35,36,49,33],
|
||||
[61,53,55,58]]
|
||||
2
C2/codes/q79_71.py
Normal file
2
C2/codes/q79_71.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
M = [['A','B','C','D'], ['E','F','G','H'],
|
||||
['I','J','K','L']]
|
||||
2
C2/codes/q7_5.py
Normal file
2
C2/codes/q7_5.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def f(x):
|
||||
return (x, x**2)
|
||||
5
C2/codes/q83_72.py
Normal file
5
C2/codes/q83_72.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def f(L):
|
||||
S = []
|
||||
for i in range(len(L)-1):
|
||||
S.append(L[i] + L[i+1])
|
||||
return S
|
||||
8
C2/codes/q84_73.py
Normal file
8
C2/codes/q84_73.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
def quoi(liste):
|
||||
maListe = []
|
||||
for i in range(len(liste))
|
||||
maListe.append(liste[i][0])
|
||||
return maListe
|
||||
|
||||
L = [[5,8,12,1], [20,11,3,8], [3,12,1,4], [2,13,17,3]]
|
||||
m = quoi(L)
|
||||
3
C2/codes/q86_74.py
Normal file
3
C2/codes/q86_74.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Table = [('Grace','Hopper','F',1906),('Tim', 'Berners-Lee',
|
||||
'H', 1955),('Ada', 'Lovelace', 'F', 1815), ('Alan',
|
||||
'Turing', 'H', 1912)]
|
||||
6
C2/codes/q86_75.py
Normal file
6
C2/codes/q86_75.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def fonctionMystere(table):
|
||||
mystere = []
|
||||
for ligne in table:
|
||||
if ligne[2] == 'F':
|
||||
mystere.append(ligne[1])
|
||||
return mystere
|
||||
2
C2/codes/q88_76.py
Normal file
2
C2/codes/q88_76.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
table = [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]
|
||||
table [1][2] = 5
|
||||
2
C2/codes/q89_77.py
Normal file
2
C2/codes/q89_77.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
a = [5, 4, 3, 4, 7]
|
||||
a.append(4)
|
||||
3
C2/codes/q8_6.py
Normal file
3
C2/codes/q8_6.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
tictactoe = [['X', 'O', 'O'],
|
||||
['O', 'O', 'O'],
|
||||
['O', 'O', 'X']]
|
||||
6
C2/codes/q90_78.py
Normal file
6
C2/codes/q90_78.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
image = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0,
|
||||
0, 0]]
|
||||
for i in range(4):
|
||||
for j in range(4):
|
||||
if (i+j) == 3:
|
||||
image[i][j] = 1
|
||||
4
C2/codes/q92_79.py
Normal file
4
C2/codes/q92_79.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
mendeleiev = [['H','.', '.','.','.','.','.','He'],
|
||||
['Li','Be','B','C','N','O','Fl','Ne'],
|
||||
['Na','Mg','Al','Si','P','S','Cl','Ar'],
|
||||
...... ]
|
||||
6
C2/codes/q93_80.py
Normal file
6
C2/codes/q93_80.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
asso = []
|
||||
L = [ ['marc','marie'], ['marie','jean'],
|
||||
['paul','marie'], ['marie','marie'], ['marc','anne'] ]
|
||||
for c in L :
|
||||
if c[1]==’marie’:
|
||||
asso.append(c[0])
|
||||
3
C2/codes/q94_81.py
Normal file
3
C2/codes/q94_81.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
a = [1, 2, 3]
|
||||
b = [4, 5, 6]
|
||||
c = a + b
|
||||
4
C2/codes/q95_82.py
Normal file
4
C2/codes/q95_82.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
mendeleiev = [['H','.', '.','.','.','.','.','He'],
|
||||
['Li','Be','B','C','N','O','Fl','Ne'],
|
||||
['Na','Mg','Al','Si','P','S','Cl','Ar'],
|
||||
...... ]
|
||||
4
C2/codes/q96_83.py
Normal file
4
C2/codes/q96_83.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
data1 = [(‘Bruce’, ’Wayne’), (‘Chuck’, ‘Norris’), (‘Bruce’,
|
||||
‘Lee’), (‘Clark’, ‘Kent’)]
|
||||
data2 = [(‘Diana’, ’Prince’), (‘Chuck’, ‘Norris’),
|
||||
(‘Peter’, ‘Parker’)]
|
||||
9
C2/codes/q97_84.py
Normal file
9
C2/codes/q97_84.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
def f(T):
|
||||
s = 0
|
||||
for k in T:
|
||||
if k == 8:
|
||||
s = s+1
|
||||
if s > 1:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
3
C2/codes/q99_85.py
Normal file
3
C2/codes/q99_85.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
collection = [('Renault', '4L', 1974, 30),
|
||||
('Peugeot', '504', 1970, 82),
|
||||
('Citroën', 'Traction', 1950, 77)]
|
||||
2
C2/codes/q9_7.py
Normal file
2
C2/codes/q9_7.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
M = [['A','B','C','D'], ['E','F','G','H'],
|
||||
['I','J','K','L']]
|
||||
2
C2/codes/r103_a.py
Normal file
2
C2/codes/r103_a.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def test(a,b):
|
||||
return a[0] < b[0]
|
||||
2
C2/codes/r103_b.py
Normal file
2
C2/codes/r103_b.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def test(a,b):
|
||||
return a[0] > b[0]
|
||||
2
C2/codes/r103_c.py
Normal file
2
C2/codes/r103_c.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def test(a,b):
|
||||
return a[1] < b[1]
|
||||
2
C2/codes/r103_d.py
Normal file
2
C2/codes/r103_d.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def test(a,b):
|
||||
return a[1] > b[1]
|
||||
4
C2/codes/r49_a.py
Normal file
4
C2/codes/r49_a.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
L = []
|
||||
for i in range(3):
|
||||
for j in range(4):
|
||||
L.append(tab[i][j])
|
||||
4
C2/codes/r49_b.py
Normal file
4
C2/codes/r49_b.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
L = []
|
||||
for i in range(4):
|
||||
for j in range(3):
|
||||
L.append(tab[i][j])
|
||||
3
C2/codes/r49_c.py
Normal file
3
C2/codes/r49_c.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
L = []
|
||||
for i in range(3):
|
||||
L.append(tab[i])
|
||||
3
C2/codes/r49_d.py
Normal file
3
C2/codes/r49_d.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
L = []
|
||||
for i in range(4):
|
||||
L.append(tab[i])
|
||||
5
C2/codes/r60_a.py
Normal file
5
C2/codes/r60_a.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def ok(echiquier,i,j):
|
||||
for col in range(i):
|
||||
if echiquier[i][col] == 1:
|
||||
return False
|
||||
return True
|
||||
5
C2/codes/r60_b.py
Normal file
5
C2/codes/r60_b.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def ok(echiquier,i,j):
|
||||
for lig in range(i):
|
||||
if echiquier[lig][j] == 1:
|
||||
return False
|
||||
return True
|
||||
5
C2/codes/r60_c.py
Normal file
5
C2/codes/r60_c.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def ok(echiquier,i,j):
|
||||
for col in range(j):
|
||||
if echiquier[i][col] == 1:
|
||||
return False
|
||||
return True
|
||||
5
C2/codes/r60_d.py
Normal file
5
C2/codes/r60_d.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def ok(echiquier,i,j):
|
||||
for lig in range(j):
|
||||
if echiquier[lig][j] == 1:
|
||||
return False
|
||||
return True
|
||||
1
C2/codes/r69_a.py
Normal file
1
C2/codes/r69_a.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
impairs = [1 + nb*2 for nb in range(200)]
|
||||
2
C2/codes/r69_b.py
Normal file
2
C2/codes/r69_b.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
for nb in range(400) :
|
||||
impairs = 1 + 2 * nb
|
||||
1
C2/codes/r69_c.py
Normal file
1
C2/codes/r69_c.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
impairs = [i + 2 for i in range(1,200)]
|
||||
1
C2/codes/r69_d.py
Normal file
1
C2/codes/r69_d.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
impairs = [1, 3, 5, 7, 9] * 40
|
||||
6
C2/codes/r75_a.py
Normal file
6
C2/codes/r75_a.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
tab = []
|
||||
for i in range(4):
|
||||
temp = []
|
||||
for j in range(3):
|
||||
temp.append(L[4*i + j])
|
||||
tab.append(temp)
|
||||
6
C2/codes/r75_b.py
Normal file
6
C2/codes/r75_b.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
tab = []
|
||||
for i in range(4):
|
||||
temp = []
|
||||
for j in range(3):
|
||||
temp.append(L[3*i + j])
|
||||
tab.append(temp)
|
||||
6
C2/codes/r75_c.py
Normal file
6
C2/codes/r75_c.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
tab = []
|
||||
for i in range(3):
|
||||
temp = []
|
||||
for j in range(4):
|
||||
temp.append(L[3*i + j])
|
||||
tab.append(temp)
|
||||
6
C2/codes/r75_d.py
Normal file
6
C2/codes/r75_d.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
tab = []
|
||||
for i in range(3):
|
||||
temp = []
|
||||
for j in range(4):
|
||||
temp.append(L[4*i + j])
|
||||
tab.append(temp)
|
||||
3
C2/codes/r77_a.py
Normal file
3
C2/codes/r77_a.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
T = []
|
||||
for k in range(10):
|
||||
T.append(2*k)
|
||||
3
C2/codes/r77_b.py
Normal file
3
C2/codes/r77_b.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
T = [0] * 10
|
||||
for k in range(9):
|
||||
T[k+1] = 2*(k+1)
|
||||
1
C2/codes/r77_c.py
Normal file
1
C2/codes/r77_c.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
T = [2*k for k in range(10)]
|
||||
3
C2/codes/r77_d.py
Normal file
3
C2/codes/r77_d.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
T = [0] * 10
|
||||
for k in range(0):
|
||||
T[k+1] = 2*T[k]
|
||||
6
C2/codes/r78_a.py
Normal file
6
C2/codes/r78_a.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def nombreDistincts(L):
|
||||
n = 1
|
||||
for i in range(1,len(L)):
|
||||
if L[i] != L[i-1]:
|
||||
n = n + 1
|
||||
return n
|
||||
6
C2/codes/r78_b.py
Normal file
6
C2/codes/r78_b.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def nombreDistincts(L):
|
||||
n = 1
|
||||
for i in range(0,len(L)-1):
|
||||
if L[i] != L[i+1]:
|
||||
n = n + 1
|
||||
return n
|
||||
6
C2/codes/r78_c.py
Normal file
6
C2/codes/r78_c.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def nombreDistincts(L):
|
||||
n = 0
|
||||
for i in range(0,len(L)-1):
|
||||
if L[i] != L[i+1]:
|
||||
n = n + 1
|
||||
return n
|
||||
6
C2/codes/r78_d.py
Normal file
6
C2/codes/r78_d.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def nombreDistincts(L):
|
||||
n = 0
|
||||
for i in range(1,len(L)):
|
||||
if L[i] != L[i-1]:
|
||||
n = n + 1
|
||||
return n
|
||||
Loading…
Add table
Add a link
Reference in a new issue