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
  • rhahn-master-patch-20471
  • master
2 results

Target

Select target project
  • Vuillemot Romain / INF-TC1
  • Wei Hanxuan / INF-TC1
  • Mbengue Ndeye / INF-TC1
  • Fernandes Antoine / INF-TC1
  • Maxime Leger / INF-TC1
  • Meng Lili / INF-TC1
  • Ferry Lacroix Gauthier / INF-TC1
  • Conso Juliette / INF-TC1
  • Maghsoudnia Sacha / INF-TC1
  • Marquet Ewen / INF-TC1
  • Cluzel Emmie / INF-TC1
  • Audeoud Alexandre / INF-TC1
  • Segond Tanguy / INF-TC1
  • Etienne Alban / INF-TC1
  • Joly Adeline / INF-TC1
  • Campeas Baptiste / INF-TC1
  • Novareze Dimitri / INF-TC1
  • Ruet Maxens / INF-TC1
  • Chenu Clement / INF-TC1
  • Guiot Du Doignon Clement / INF-TC1
20 results
Select Git revision
  • master
1 result
Show changes

Commits on Source 1

1 file
+ 57
7
Compare changes
  • Side-by-side
  • Inline

Files

+57 −7
Original line number Diff line number Diff line
@@ -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",