- Add element to ArrayList
- Add element at particular index of ArrayList
- Append Collection elements to ArrayList
- Copy All List elements to ArrayList
- Insert all the collection elements to the specified position in ArrayList
- Remove element from the specified index in ArrayList
- Remove specified element from ArrayList
- Sort ArrayList
- Sort ArrayList in Descending order
- Sort ArrayList of Objects using Comparable and Comparator
- ArrayList
- LinkedList
- Vector
- HashSet
- LinkedHashSet
- TreeSet
- HashMap
- TreeMap
- LinkedHashMap
- Hashtable
- Use Protection
- Handling Events
- Adding AJAX
- Update main.js:
- Update forms.py:
- Update main.js:
- Update the views
- Updating the DOM
- Update the template
- Update main.js
The yield statement suspends function’s execution and sends a value back to caller, but retains enough state to enable function to resume where it is left off.
When resumed, the function continues execution immediately after the last yield run.
This allows its code to produce a series of values over time, rather them computing them at once and sending them back like a list.
# A Simple Python program to demonstrate working
# of yield
In C/C++ and Java, we can write empty function as following
// An empty function in C/C++/Java
void fun() { }
In Python, if we write something like following in Python, it would produce compiler error.
# Incorrect empty function in Python
def fun():
- In Python, we can define a function inside another function.
- In Python, a function can be passed as parameter to another function
- In Python, a function can also return another function
# A Python program to demonstrate that a function
# can be defined inside another function and a
# function can be passed as parameter.
# Adds a welcome message to the string