Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • rhahn-master-patch-20471
2 results

Target

Select target project
  • rvuillem/inf-tc1
  • hwei/inf-tc1
  • nmbengue/inf-tc1
  • fernanda/inf-tc1
  • mleger/inf-tc1
  • lmeng/inf-tc1
  • gferryla/inf-tc1
  • jconso/inf-tc1
  • smaghsou/inf-tc1
  • emarquet/inf-tc1
  • ecluzel/inf-tc1
  • aaudeoud/inf-tc1
  • tsegond/inf-tc1
  • aetienne/inf-tc1
  • djoly/inf-tc1
  • bcampeas/inf-tc1
  • dnovarez/inf-tc1
  • ruetm/inf-tc1
  • cchenu/inf-tc1
  • cguiotdu/inf-tc1
  • mclouard/inf-tc1
  • gwachowi/inf-tc1
  • qbaalaou/inf-tc1
  • sbrocas/inf-tc1
  • ppupion/inf-tc1
  • kinty/inf-tc1
  • hadomo/inf-tc1
  • tgicquel/inf-tc1
  • rhahn/inf-tc1
  • cguyau/inf-tc1
  • mpairaul/inf-tc1
  • rmuller/inf-tc1
  • rlecharp/inf-tc1
  • asebasty/inf-tc1
  • qmaler/inf-tc1
  • aoussaid/inf-tc1
  • kcherigu/inf-tc1
  • sgu/inf-tc1
  • malcalat/inf-tc1
  • afalourd/inf-tc1
  • phugues/inf-tc1
  • lsteunou/inf-tc1
  • llauschk/inf-tc1
  • langloia/inf-tc1
  • aboucard/inf-tc1
  • wmellali/inf-tc1
  • ifaraidi/inf-tc1
  • lir/inf-tc1
  • ynedjar/inf-tc1
  • schneidl/inf-tc1
  • zprandi/inf-tc1
  • acoradid/inf-tc1
  • amarcq/inf-tc1
  • dcombet/inf-tc1
  • mrosini/inf-tc1
  • gplaud/inf-tc1
  • mkernoaj/inf-tc1
  • bboyer/inf-tc1
  • gbichot/inf-tc1
  • tdutille/inf-tc1
60 results
Select Git revision
  • master
1 result
Show changes

Commits on Source 1

......@@ -247,7 +247,13 @@
"outputs": [],
"source": [
"def average_grade(L: list)-> int:\n",
" # YOUR CODE HERE\n",
" def average_grade(L:list)-> int:
moyenne = 0
N = len(L)
for student in L:
moyenne+= int(student['note'])
moyenne = moyenne/N
return(moyenne),
" raise NotImplementedError()"
]
},
......@@ -322,7 +328,16 @@
"outputs": [],
"source": [
"def find_maximum_recursive(L: list)-> str:\n",
" # YOUR CODE HERE\n",
" def find_maximum_recursive(L:list)->int:
m = float(L[-1]['note'])
if len(L) == 1:
return float(L[0]['note'])
else:
n = len(L)
L=L[:n-1]
if float(find_maximum_recursive(L))>m:
m = float(find_maximum_recursive(L))
return m,
" raise NotImplementedError()"
]
},
......@@ -371,7 +386,14 @@
"outputs": [],
"source": [
"def find_same_grade(L: list)-> tuple:\n",
" # YOUR CODE HERE\n",
" def find_same_grade(L:list)->tuple:
l=[int(student['note']) for student in L]
S = set({})
for i in range(len(l)):
for j in range(len(l)):
if (l[i],j) in S and i!=j:
return (L[i]['nom'],L[j]['nom'])
S.add((l[i],i)),
" raise NotImplementedError()"
]
},
......@@ -441,7 +463,18 @@
"outputs": [],
"source": [
"def sort_selection(L: list, key=lambda x: x) -> list:\n",
" # YOUR CODE HERE\n",
" def sort_selection(L:list,critere:str)->list:
n = len(L)
for i in range(0,n-1):
minimum = i
for j in range(minimum,n):
if L[j][critere] < L[minimum][critere]:
minimum = j
if min != i:
val = L[i]
L[i] = L[minimum]
L[minimum] = val
return L,
" raise NotImplementedError()"
]
},
......@@ -570,7 +603,9 @@
"source": [
"pile = queue.LifoQueue()\n",
"s = Stack()\n",
"# YOUR CODE HERE\n",
"for etu in students_list:
s.push(etu)
pile.put(etu)",
"raise NotImplementedError()\n",
"\n",
"while not s.is_empty() and not pile.empty():\n",
......@@ -606,7 +641,20 @@
"outputs": [],
"source": [
"class Queue():\n",
" # YOUR CODE HERE\n",
"
class Queue:
def __init__(self):
self.items = []
def push(self,item):
self.items.append(item)
def pop(self):
if not self.is_empty():
return self.items.pop(0)
def peek(self):
if not self.is_empty():
return self.items[0]
def is_empty(self):
return len(self.items) == 0",
" raise NotImplementedError()"
]
},
......@@ -632,7 +680,9 @@
"source": [
"file = queue.Queue()\n",
"f = Queue()\n",
"# YOUR CODE HERE\n",
"for etu in students_list:
f.push(etu)
file.put(etu)",
"raise NotImplementedError()\n",
"\n",
"while not f.is_empty() and not file.empty():\n",
......