HUN

3/1. advanced_indexing

Írjunk függvényt, aminek bemenete egy lista és egy indexek listája:Kimenetként a lista azon elemeit adjuk vissza, amely indexek a második listában szerepeltek
Például ha indexek=[0, 1, 0] akkor egy három elemű listát kell visszaadni,aminek elemei rendre a lista nulladik, első és ismét a nulladik elemei.
Az indexek között nem lesz olyan, ami kívül esne az első lista indexein.

3/2. matrix_sum

Írjunk függvényt mely a bementi M1 és M2 mátrixoknak visszaadja az összegét. Ha a mátrixok nem adhatók össze, akkor üreslistával tér vissza.

Például a következõ függvényhívásra:

A = [[1, 2, 3], [4, 5, 6]]
B = [[1, 1, 1], [1, 1, 1]]
matrix_sum(A, B)
ezt a mátrixot adja vissza:
[[2, 3, 4], [5, 6, 7]]

3/3. divisor_dict

Egy nagyobb programban amin dolgozunk, bizonyos számok kisebb osztóinak a listájára gyakran szükség van. Ezért nem szeretnénk mindig újra kiszámolni az osztók listáját amikor kell, hanem ezekre a gyakran előforduló számokra kiszámolnánk egyszer előre, és mindegyik számhoz letárolnánk az osztói listáját egy szótárba.
Az divisor_dict nevű függvény paramétereA függvény egy szótárral kéne hogy visszatérjen, amiben kulcsként szerepel l-ből minden szám, és mindhez a nála kisebb osztóinak a nagyság szerint növekvő listája van rendelve.
Például az l=[3,10,12] esetén a következőt kell kapnunk:
{3: [1], 10: [1,2,5], 12: [1,2,3,4,6] }

3/4. midterm_result

Írjunk egy függvényt, ami jegyre váltja a ZH pontunkat.Például az infó ZH-ban a ponthatárok ezek lennének:
{2:50,3:60,4:70,5:80}
Az egyesnek nincsen külön ponthatára, mert a kettes alatti mindig automatikusan 1-es (nullást nem lehet kapni). És az 5-ös alsó határa felett minden pont 5-ösnek számít.

Figyelem

A ponthatárok <= relációban számítanak, vagyis ha valaki pont az alsó ponthatáron van, akkor még megkapja az adott jegyet.

ENG

3/1. advanced_indexing

Write a function with two parameters:The output should be the elements from the first list according to the indices.
For example if indices=[0, 1, 0] then you should return a three element listcontaining the zeroth, first and zeroth elements of the original list.
The parameter indices won't contain bigger indices than the maximum index in L.

3/2. matrix_sum

Write a function with two input parameters: M1 and M2,those are arrays: list of list of numbers.Return the sum of the matrices if they are compatible, or an empty list otherwise.

For example:

A = [[1, 2, 3], [4, 5, 6]]
B = [[1, 1, 1], [1, 1, 1]]
matrix_sum(A, B)
You get:
[[2, 3, 4], [5, 6, 7]]

3/3. divisor_dict

In a program one needs to calculate a lots of divisors.What you want to do is to store the already calculated divisors.To this end you have to make a dictionary of numbers and their divisors.

There is a code which does something similar, but it is working incorrectly, you have to fix it!
The function called divisor_dict and has one argument:The function should return a dictionary, where the keys are theinput numbers and their values are the sorted list of their divisors (not including the number itself).

For example is l=[3,10,12] then the result should be
{3: [1], 10: [1,2,5], 12: [1,2,3,4,6] }

3/4. midterm_result

Write a function that converts your midterm points into grades.For example in Informatics the limits are:
{2:50,3:60,4:70,5:80}
The worst grade doesn't have a lower bound, because everything under the lower bound of 2 worth 1. You cannot get a 0 grade. And everything above the limit of 5 is a 5.

Hint

The lower bounds should compare as <= since reaching the limit exactly still worth the grade.