Funkcije višjega reda so ena najkoristnejših stvari, ki jih boš... Show more
Sign up to see the contentIt's free!
Access to all documents
Improve your grades
Join milions of students
Knowunity AI
Subjects
Triangle Congruence and Similarity Theorems
Triangle Properties and Classification
Linear Equations and Graphs
Geometric Angle Relationships
Trigonometric Functions and Identities
Equation Solving Techniques
Circle Geometry Fundamentals
Division Operations and Methods
Basic Differentiation Rules
Exponent and Logarithm Properties
Show all topics
Human Organ Systems
Reproductive Cell Cycles
Biological Sciences Subdisciplines
Cellular Energy Metabolism
Autotrophic Energy Processes
Inheritance Patterns and Principles
Biomolecular Structure and Organization
Cell Cycle and Division Mechanics
Cellular Organization and Development
Biological Structural Organization
Show all topics
Chemical Sciences and Applications
Atomic Structure and Composition
Molecular Electron Structure Representation
Atomic Electron Behavior
Matter Properties and Water
Mole Concept and Calculations
Gas Laws and Behavior
Periodic Table Organization
Chemical Thermodynamics Fundamentals
Chemical Bond Types and Properties
Show all topics
European Renaissance and Enlightenment
European Cultural Movements 800-1920
American Revolution Era 1763-1797
American Civil War 1861-1865
Global Imperial Systems
Mongol and Chinese Dynasties
U.S. Presidents and World Leaders
Historical Sources and Documentation
World Wars Era and Impact
World Religious Systems
Show all topics
Classic and Contemporary Novels
Literary Character Analysis
Rhetorical Theory and Practice
Classic Literary Narratives
Reading Analysis and Interpretation
Narrative Structure and Techniques
English Language Components
Influential English-Language Authors
Basic Sentence Structure
Narrative Voice and Perspective
Show all topics
3
•
Updated Apr 17, 2026
•
Funkcije višjega reda so ena najkoristnejših stvari, ki jih boš... Show more








Če si se kdaj spraševal, zakaj programerji pišejo tako elegantno kodo, so funkcije višjega reda eden izmed njihovih skrivnih trikov. Te funkcije ti omogočajo, da namesto pisanja 10 podobnih zank napišeš eno pametno funkcijo in ji enostavno pošiljaš različne "navodila".
Funkcija višjega reda (HOF) mora izpolniti vsaj enega od dveh pogojev: sprejme funkcijo kot argument ali vrne funkcijo kot rezultat. To ti omogoča pisanje bolj splošne in ponovno uporabne kode.
Trije ključni pojmi, ki jih moraš obvladati: callback funkcija (funkcija, ki jo pošlješ drugi funkciji), zaprtje (funkcija si zapomni svoje okolje) in seveda sama HOF.
💡 Nasvet: Funkcije višjega reda uporabljaš verjetno že zdaj, če si kdaj uporabil
map()alifilter()v Pythonu!

Predstavljaj si, da imaš seznam številk in želiš nanje uporabiti različne operacije. Brez HOF bi moral napisati posebno funkcijo za vsako operacijo - ogromno ponavljanja kode!
Namesto tega lahko napišeš eno splošno funkcijo, ki sprejme seznam IN funkcijo, ki pove, kaj naj naredi:
def uporabi_na_seznamu(seznam, operacija):
nov_seznam = []
for x in seznam:
nov_seznam.append(operacija(x))
return nov_seznam
def podvoji(n):
return n * 2
Zdaj lahko enostavno pokličeš uporabi_na_seznamu([1,2,3], podvoji) in dobiš [2,4,6]. Ključno je: glavna funkcija ne ve, kaj počne operacija - jo samo pokliče!
💡 Hiter trik: Z lambda funkcijami lahko to naredišь še krajše:
uporabi_na_seznamu

Tu postane zanimivo - funkcija lahko vrne drugo funkcijo! To ti omogoča ustvarjanje specializiranih funkcij "na zahtevo".
Recimo, da želiš ustvariti različne množilnike:
def ustvari_mnozilnik(n):
def mnozilnik(x):
return x * n # Ta funkcija "vidi" n iz zunanjega obsega!
return mnozilnik
mnozi_s_3 = ustvari_mnozilnik(3)
rezultat = mnozi_s_3(5) # vrne 15
Tu se zgodi nekaj čudežnega: funkcija mnozilnik si zapomni vrednost n, čeprav se je zunanja funkcija že končala. To se imenuje zaprtje (closure).
Praktično to pomeni, da lahko ustvariš cele "tovarne" specializiranih funkcij, kar je super za organizacijo kode.
💡 Za maturo: Zaprtje omogoča funkcijam dostop do spremenljivk iz zunanjega obsega, tudi po končani izvedbi zunanje funkcije!

Python ima vgrajene HOF, ki ti rešijo veliko dela. Filter() ti pomaga izbrati elemente iz seznama, map() pa jih preoblikuje.
Za filtriranje sodih števil:
stevila = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def je_sodo(n):
return n % 2 == 0
soda_stevila = list(filter(je_sodo, stevila))
# Rezultat: [2, 4, 6, 8, 10]
Za pretvorbo imena v velike začetnice:
imena = ["ana", "boris", "cilka"]
imena_z_veliko = list(map(lambda s: s.capitalize(), imena))
# Rezultat: ['Ana', 'Boris', 'Cilka']
Pomembno: map() in filter() vrneta iterator, ne seznama! Zato potrebuješ list() za pretvorbo.
💡 Prihranek časa: Lambda funkcije so perfektne za kratke operacije pri HOF - en sam stavek brez def!

Lambda funkcije so tvoj najboljši prijatelj pri HOF - omogočajo ti definiranje kratkih funkcij kar na mestu uporabe: lambda argumenti: izraz.
Tri glavne operacije, ki jih moraš obvladati:
map())filter())reduce())Prednosti HOF: manj podvojene kode, bolj berljiva koda, večja prožnost. Namesto da povešь kako naj računalnik nekaj naredi, povešь kaj naj naredi.
Pasti: Najboljše callback funkcije so "čiste" - za enak vhod vedno vrnejo enak rezultat in ne spreminjajo ničesar drugje.
💡 Za oceno 5: Razumi razliko med deklarativnim (kaj naj se naredi) in imperativnim (kako naj se naredi) programiranjem!


Our AI companion is specifically built for the needs of students. Based on the millions of content pieces we have on the platform we can provide truly meaningful and relevant answers to students. But its not only about answers, the companion is even more about guiding students through their daily learning challenges, with personalised study plans, quizzes or content pieces in the chat and 100% personalisation based on the students skills and developments.
You can download the app in the Google Play Store and in the Apple App Store.
That's right! Enjoy free access to study content, connect with fellow students, and get instant help – all at your fingertips.
App Store
Google Play
The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.
Stefan S
iOS user
This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.
Samantha Klich
Android user
Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.
Anna
iOS user
I think it’s very much worth it and you’ll end up using it a lot once you get the hang of it and even after looking at others notes you can still ask your Artificial intelligence buddy the question and ask to simplify it if you still don’t get it!!! In the end I think it’s worth it 😊👍 ⚠️Also DID I MENTION ITS FREEE YOU DON’T HAVE TO PAY FOR ANYTHING AND STILL GET YOUR GRADES IN PERFECTLY❗️❗️⚠️
Thomas R
iOS user
Knowunity is the BEST app I’ve used in a minute. This is not an ai review or anything this is genuinely coming from a 7th grade student (I know 2011 im young) but dude this app is a 10/10 i have maintained a 3.8 gpa and have plenty of time for gaming. I love it and my mom is just happy I got good grades
Brad T
Android user
Not only did it help me find the answer but it also showed me alternative ways to solve it. I was horrible in math and science but now I have an a in both subjects. Thanks for the help🤍🤍
David K
iOS user
The app's just great! All I have to do is enter the topic in the search bar and I get the response real fast. I don't have to watch 10 YouTube videos to understand something, so I'm saving my time. Highly recommended!
Sudenaz Ocak
Android user
In school I was really bad at maths but thanks to the app, I am doing better now. I am so grateful that you made the app.
Greenlight Bonnie
Android user
I found this app a couple years ago and it has only gotten better since then. I really love it because it can help with written questions and photo questions. Also, it can find study guides that other people have made as well as flashcard sets and practice tests. The free version is also amazing for students who might not be able to afford it. Would 100% recommend
Aubrey
iOS user
Best app if you're in Highschool or Junior high. I have been using this app for 2 school years and it's the best, it's good if you don't have anyone to help you with school work.😋🩷🎀
Marco B
iOS user
THE QUIZES AND FLASHCARDS ARE SO USEFUL AND I LOVE Knowunity AI. IT ALSO IS LITREALLY LIKE CHATGPT BUT SMARTER!! HELPED ME WITH MY MASCARA PROBLEMS TOO!! AS WELL AS MY REAL SUBJECTS ! DUHHH 😍😁😲🤑💗✨🎀😮
Elisha
iOS user
This app is phenomenal down to the correct info and the various topics you can study! I greatly recommend it for people who struggle with procrastination and those who need homework help. It has been perfectly accurate for world 1 history as far as I’ve seen! Geometry too!
Paul T
iOS user
The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.
Stefan S
iOS user
This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.
Samantha Klich
Android user
Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.
Anna
iOS user
I think it’s very much worth it and you’ll end up using it a lot once you get the hang of it and even after looking at others notes you can still ask your Artificial intelligence buddy the question and ask to simplify it if you still don’t get it!!! In the end I think it’s worth it 😊👍 ⚠️Also DID I MENTION ITS FREEE YOU DON’T HAVE TO PAY FOR ANYTHING AND STILL GET YOUR GRADES IN PERFECTLY❗️❗️⚠️
Thomas R
iOS user
Knowunity is the BEST app I’ve used in a minute. This is not an ai review or anything this is genuinely coming from a 7th grade student (I know 2011 im young) but dude this app is a 10/10 i have maintained a 3.8 gpa and have plenty of time for gaming. I love it and my mom is just happy I got good grades
Brad T
Android user
Not only did it help me find the answer but it also showed me alternative ways to solve it. I was horrible in math and science but now I have an a in both subjects. Thanks for the help🤍🤍
David K
iOS user
The app's just great! All I have to do is enter the topic in the search bar and I get the response real fast. I don't have to watch 10 YouTube videos to understand something, so I'm saving my time. Highly recommended!
Sudenaz Ocak
Android user
In school I was really bad at maths but thanks to the app, I am doing better now. I am so grateful that you made the app.
Greenlight Bonnie
Android user
I found this app a couple years ago and it has only gotten better since then. I really love it because it can help with written questions and photo questions. Also, it can find study guides that other people have made as well as flashcard sets and practice tests. The free version is also amazing for students who might not be able to afford it. Would 100% recommend
Aubrey
iOS user
Best app if you're in Highschool or Junior high. I have been using this app for 2 school years and it's the best, it's good if you don't have anyone to help you with school work.😋🩷🎀
Marco B
iOS user
THE QUIZES AND FLASHCARDS ARE SO USEFUL AND I LOVE Knowunity AI. IT ALSO IS LITREALLY LIKE CHATGPT BUT SMARTER!! HELPED ME WITH MY MASCARA PROBLEMS TOO!! AS WELL AS MY REAL SUBJECTS ! DUHHH 😍😁😲🤑💗✨🎀😮
Elisha
iOS user
This app is phenomenal down to the correct info and the various topics you can study! I greatly recommend it for people who struggle with procrastination and those who need homework help. It has been perfectly accurate for world 1 history as far as I’ve seen! Geometry too!
Paul T
iOS user
Funkcije višjega reda so ena najkoristnejših stvari, ki jih boš spoznal v programiranju! To so preprosto funkcije, ki delujejo z drugimi funkcijami - lahko jih sprejmejo kot argument ali pa vrnejo novo funkcijo.

Access to all documents
Improve your grades
Join milions of students
Če si se kdaj spraševal, zakaj programerji pišejo tako elegantno kodo, so funkcije višjega reda eden izmed njihovih skrivnih trikov. Te funkcije ti omogočajo, da namesto pisanja 10 podobnih zank napišeš eno pametno funkcijo in ji enostavno pošiljaš različne "navodila".
Funkcija višjega reda (HOF) mora izpolniti vsaj enega od dveh pogojev: sprejme funkcijo kot argument ali vrne funkcijo kot rezultat. To ti omogoča pisanje bolj splošne in ponovno uporabne kode.
Trije ključni pojmi, ki jih moraš obvladati: callback funkcija (funkcija, ki jo pošlješ drugi funkciji), zaprtje (funkcija si zapomni svoje okolje) in seveda sama HOF.
💡 Nasvet: Funkcije višjega reda uporabljaš verjetno že zdaj, če si kdaj uporabil
map()alifilter()v Pythonu!

Access to all documents
Improve your grades
Join milions of students
Predstavljaj si, da imaš seznam številk in želiš nanje uporabiti različne operacije. Brez HOF bi moral napisati posebno funkcijo za vsako operacijo - ogromno ponavljanja kode!
Namesto tega lahko napišeš eno splošno funkcijo, ki sprejme seznam IN funkcijo, ki pove, kaj naj naredi:
def uporabi_na_seznamu(seznam, operacija):
nov_seznam = []
for x in seznam:
nov_seznam.append(operacija(x))
return nov_seznam
def podvoji(n):
return n * 2
Zdaj lahko enostavno pokličeš uporabi_na_seznamu([1,2,3], podvoji) in dobiš [2,4,6]. Ključno je: glavna funkcija ne ve, kaj počne operacija - jo samo pokliče!
💡 Hiter trik: Z lambda funkcijami lahko to naredišь še krajše:
uporabi_na_seznamu

Access to all documents
Improve your grades
Join milions of students
Tu postane zanimivo - funkcija lahko vrne drugo funkcijo! To ti omogoča ustvarjanje specializiranih funkcij "na zahtevo".
Recimo, da želiš ustvariti različne množilnike:
def ustvari_mnozilnik(n):
def mnozilnik(x):
return x * n # Ta funkcija "vidi" n iz zunanjega obsega!
return mnozilnik
mnozi_s_3 = ustvari_mnozilnik(3)
rezultat = mnozi_s_3(5) # vrne 15
Tu se zgodi nekaj čudežnega: funkcija mnozilnik si zapomni vrednost n, čeprav se je zunanja funkcija že končala. To se imenuje zaprtje (closure).
Praktično to pomeni, da lahko ustvariš cele "tovarne" specializiranih funkcij, kar je super za organizacijo kode.
💡 Za maturo: Zaprtje omogoča funkcijam dostop do spremenljivk iz zunanjega obsega, tudi po končani izvedbi zunanje funkcije!

Access to all documents
Improve your grades
Join milions of students
Python ima vgrajene HOF, ki ti rešijo veliko dela. Filter() ti pomaga izbrati elemente iz seznama, map() pa jih preoblikuje.
Za filtriranje sodih števil:
stevila = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
def je_sodo(n):
return n % 2 == 0
soda_stevila = list(filter(je_sodo, stevila))
# Rezultat: [2, 4, 6, 8, 10]
Za pretvorbo imena v velike začetnice:
imena = ["ana", "boris", "cilka"]
imena_z_veliko = list(map(lambda s: s.capitalize(), imena))
# Rezultat: ['Ana', 'Boris', 'Cilka']
Pomembno: map() in filter() vrneta iterator, ne seznama! Zato potrebuješ list() za pretvorbo.
💡 Prihranek časa: Lambda funkcije so perfektne za kratke operacije pri HOF - en sam stavek brez def!

Access to all documents
Improve your grades
Join milions of students
Lambda funkcije so tvoj najboljši prijatelj pri HOF - omogočajo ti definiranje kratkih funkcij kar na mestu uporabe: lambda argumenti: izraz.
Tri glavne operacije, ki jih moraš obvladati:
map())filter())reduce())Prednosti HOF: manj podvojene kode, bolj berljiva koda, večja prožnost. Namesto da povešь kako naj računalnik nekaj naredi, povešь kaj naj naredi.
Pasti: Najboljše callback funkcije so "čiste" - za enak vhod vedno vrnejo enak rezultat in ne spreminjajo ničesar drugje.
💡 Za oceno 5: Razumi razliko med deklarativnim (kaj naj se naredi) in imperativnim (kako naj se naredi) programiranjem!

Access to all documents
Improve your grades
Join milions of students

Access to all documents
Improve your grades
Join milions of students
Our AI companion is specifically built for the needs of students. Based on the millions of content pieces we have on the platform we can provide truly meaningful and relevant answers to students. But its not only about answers, the companion is even more about guiding students through their daily learning challenges, with personalised study plans, quizzes or content pieces in the chat and 100% personalisation based on the students skills and developments.
You can download the app in the Google Play Store and in the Apple App Store.
That's right! Enjoy free access to study content, connect with fellow students, and get instant help – all at your fingertips.
0
Smart Tools NEW
Transform this note into: ✓ 50+ Practice Questions ✓ Interactive Flashcards ✓ Full Practice Test ✓ Essay Outlines
App Store
Google Play
The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.
Stefan S
iOS user
This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.
Samantha Klich
Android user
Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.
Anna
iOS user
I think it’s very much worth it and you’ll end up using it a lot once you get the hang of it and even after looking at others notes you can still ask your Artificial intelligence buddy the question and ask to simplify it if you still don’t get it!!! In the end I think it’s worth it 😊👍 ⚠️Also DID I MENTION ITS FREEE YOU DON’T HAVE TO PAY FOR ANYTHING AND STILL GET YOUR GRADES IN PERFECTLY❗️❗️⚠️
Thomas R
iOS user
Knowunity is the BEST app I’ve used in a minute. This is not an ai review or anything this is genuinely coming from a 7th grade student (I know 2011 im young) but dude this app is a 10/10 i have maintained a 3.8 gpa and have plenty of time for gaming. I love it and my mom is just happy I got good grades
Brad T
Android user
Not only did it help me find the answer but it also showed me alternative ways to solve it. I was horrible in math and science but now I have an a in both subjects. Thanks for the help🤍🤍
David K
iOS user
The app's just great! All I have to do is enter the topic in the search bar and I get the response real fast. I don't have to watch 10 YouTube videos to understand something, so I'm saving my time. Highly recommended!
Sudenaz Ocak
Android user
In school I was really bad at maths but thanks to the app, I am doing better now. I am so grateful that you made the app.
Greenlight Bonnie
Android user
I found this app a couple years ago and it has only gotten better since then. I really love it because it can help with written questions and photo questions. Also, it can find study guides that other people have made as well as flashcard sets and practice tests. The free version is also amazing for students who might not be able to afford it. Would 100% recommend
Aubrey
iOS user
Best app if you're in Highschool or Junior high. I have been using this app for 2 school years and it's the best, it's good if you don't have anyone to help you with school work.😋🩷🎀
Marco B
iOS user
THE QUIZES AND FLASHCARDS ARE SO USEFUL AND I LOVE Knowunity AI. IT ALSO IS LITREALLY LIKE CHATGPT BUT SMARTER!! HELPED ME WITH MY MASCARA PROBLEMS TOO!! AS WELL AS MY REAL SUBJECTS ! DUHHH 😍😁😲🤑💗✨🎀😮
Elisha
iOS user
This app is phenomenal down to the correct info and the various topics you can study! I greatly recommend it for people who struggle with procrastination and those who need homework help. It has been perfectly accurate for world 1 history as far as I’ve seen! Geometry too!
Paul T
iOS user
The app is very easy to use and well designed. I have found everything I was looking for so far and have been able to learn a lot from the presentations! I will definitely use the app for a class assignment! And of course it also helps a lot as an inspiration.
Stefan S
iOS user
This app is really great. There are so many study notes and help [...]. My problem subject is French, for example, and the app has so many options for help. Thanks to this app, I have improved my French. I would recommend it to anyone.
Samantha Klich
Android user
Wow, I am really amazed. I just tried the app because I've seen it advertised many times and was absolutely stunned. This app is THE HELP you want for school and above all, it offers so many things, such as workouts and fact sheets, which have been VERY helpful to me personally.
Anna
iOS user
I think it’s very much worth it and you’ll end up using it a lot once you get the hang of it and even after looking at others notes you can still ask your Artificial intelligence buddy the question and ask to simplify it if you still don’t get it!!! In the end I think it’s worth it 😊👍 ⚠️Also DID I MENTION ITS FREEE YOU DON’T HAVE TO PAY FOR ANYTHING AND STILL GET YOUR GRADES IN PERFECTLY❗️❗️⚠️
Thomas R
iOS user
Knowunity is the BEST app I’ve used in a minute. This is not an ai review or anything this is genuinely coming from a 7th grade student (I know 2011 im young) but dude this app is a 10/10 i have maintained a 3.8 gpa and have plenty of time for gaming. I love it and my mom is just happy I got good grades
Brad T
Android user
Not only did it help me find the answer but it also showed me alternative ways to solve it. I was horrible in math and science but now I have an a in both subjects. Thanks for the help🤍🤍
David K
iOS user
The app's just great! All I have to do is enter the topic in the search bar and I get the response real fast. I don't have to watch 10 YouTube videos to understand something, so I'm saving my time. Highly recommended!
Sudenaz Ocak
Android user
In school I was really bad at maths but thanks to the app, I am doing better now. I am so grateful that you made the app.
Greenlight Bonnie
Android user
I found this app a couple years ago and it has only gotten better since then. I really love it because it can help with written questions and photo questions. Also, it can find study guides that other people have made as well as flashcard sets and practice tests. The free version is also amazing for students who might not be able to afford it. Would 100% recommend
Aubrey
iOS user
Best app if you're in Highschool or Junior high. I have been using this app for 2 school years and it's the best, it's good if you don't have anyone to help you with school work.😋🩷🎀
Marco B
iOS user
THE QUIZES AND FLASHCARDS ARE SO USEFUL AND I LOVE Knowunity AI. IT ALSO IS LITREALLY LIKE CHATGPT BUT SMARTER!! HELPED ME WITH MY MASCARA PROBLEMS TOO!! AS WELL AS MY REAL SUBJECTS ! DUHHH 😍😁😲🤑💗✨🎀😮
Elisha
iOS user
This app is phenomenal down to the correct info and the various topics you can study! I greatly recommend it for people who struggle with procrastination and those who need homework help. It has been perfectly accurate for world 1 history as far as I’ve seen! Geometry too!
Paul T
iOS user