en
Feedback

Don't get caught by a cheater! Telemetrio finds and tags such channels 👉 If you want to see the tag, subscribe

Free Python Course

Free Python Course

Open in Telegram
5 967
Subscribers
No data24 hours
-357 days
-22530 days
Posts Archive
RECURSION EXAMPLE This is a recursive function to find the factorial of an integer
RECURSION EXAMPLE This is a recursive function to find the factorial of an integer

DISADVANTAGE OF RECURSION Sometimes the logic behind recursion is hard to follow through. Recursive calls are expensive (inefficient) as they take up a lot of memory and time. Recursive functions are hard to debug.

ADVANTAGE OF RECURSION Recursive functions make the code look clean and elegant. A complex task can be broken down into simpler subproblems using recursion. Sequence generation is easier with recursion than using some nested iteration.

RECURSION Python also accepts function recursion, which means a defined function can call itself. Recursion is a common mathe
RECURSION Python also accepts function recursion, which means a defined function can call itself. Recursion is a common mathematical and programming concept. It means that a function calls itself. This has the benefit of meaning that you can loop through data to reach a result.

ARGUMENT OR PARAMETER ? The terms parameter and argument can be used for the same thing: information that are passed into a function. From a function's perspective : A parameter is the variable listed inside the parentheses in the function definition. An argument is the value that is sent to the function when it is called.

EXAMPLE 2 : FUNCTION WITH TWO ARGUMENT
EXAMPLE 2 : FUNCTION WITH TWO ARGUMENT

EXAMPLE 1 : FUNCTION WITH ONE ARGUMENT def myFunction(fname): print("Hello " + fname) myFunction("Rushi") myFunction("Atharva") myFunction("Aniket") Output Hello Rushi Hello Atharva Hello Aniket

ARGUMENT Information can be passed into functions as arguments. Arguments are specified after the function name, inside the parentheses. You can add as many arguments as you want, just separate them with a comma. The following example has a function with one argument (fname). When the function is called, we pass along a first name, which is used inside the function to print the full name:

EXAMPLE : def welcome(): print('Welcome to CodeWithRushi') # call the function welcome() print('Outside function') Output Welcome to CodeWithRushi Outside function

CALLING A FUNCTION In Python a function is defined using the def keyword: def my_function(): print("Hello from a function")

CREATING A FUNCTION In Python a function is defined using the def keyword: def my_function(): print("Hello from a function")

TYPES OF FUNCTION There are two types of function in Python programming: Standard library functions - These are built-in functions in Python that are available to use. User-defined functions - We can create our own functions based on our requirements.

WHAT IS FUNCTION ? A function is a block of code which only runs when it is called. You can pass data, known as parameters, into a function. A function can return data as a result.

Coming Today 🔥

When you want Chapter 7th
Anonymous voting

Get Free Python Course Pdf Access Now 👍 Link : https://shrs.link/6zQ8wy This offer is only available for 7 days download pdf fast🔥

Get Codes Of Url Shortner Bot 🔗 Link : https://shrs.link/k53zY8 Watch Video Then You Will Know How To Get The Codes

WHAT WILL YOU LEARN : 1. What is Function ? 2. Types of Function 3. Parameter or Arguments 4. Recursion 5. *args and **kwargs 6. Lambda Expression 7. Map Function 8. Zip Function 9. Any & all Function 10. Reduce Function 11. Max & Min Function 12. Filter Function

Next We Will Start Chapter 7th : FUNCTIONS IN PYTHON