This document discusses pointers in C programming. It defines pointers as variables that store the address of another variable. It explains that pointers use the & operator to get the address of a variable and the * operator to dereference a pointer and access the value of the variable being pointed to. The document also discusses pointer arithmetic, where incrementing or decrementing a pointer moves it to the next or previous memory location. It provides an example using a float array to demonstrate pointer arithmetic and updating array elements through a pointer.
Introduction to pointers and memory management in CUri Dekel
The document is an introduction to pointers and memory management in C. It discusses computer memory, how variables and function calls are implemented, and introduces pointers as a way to overcome limitations of passing arguments by value. It covers pointer arithmetic, arrays, and dynamic memory allocation using malloc and free. The goal is to help understand concepts and techniques while noting caveats.
1. The document discusses pointers in C including declaring and initializing pointer variables, pointer operators like & and *, calling functions by reference using pointers, pointer arithmetic, and the relationship between pointers and arrays.
2. Key topics covered include using pointers to simulate call-by-reference, dereferencing pointers with *, taking addresses of variables with &, and implementing a bubble sort using pointers passed as arguments.
3. Pointer arithmetic allows incrementing, decrementing, adding/subtracting integers to pointers, and comparing pointers.
The document provides an introduction to functions in Python. It begins by explaining that a function is a block of code that runs when called. It then discusses how functions can take in parameters and return values. The document walks through examples of creating, calling, and writing functions. It also covers topics like default parameter values, arbitrary arguments, and using a main function.
Functions allow programmers to organize code into reusable blocks. A function is defined using the def keyword and can accept parameters. The body of a function contains a set of statements that run when the function is called. Functions can return values and allow code to be reused, reducing errors and improving readability. Parameters allow information to be passed into functions, while return values allow functions to provide results.
Python programming - Functions and list and tuplesMalligaarjunanN
- A function is a block of reusable code that takes in parameters, performs an action, and returns a value. Functions provide modularity and code reusability.
- Functions in Python are defined using the def keyword followed by the function name and parameters in parentheses. The code block is indented and can return a value. Parameters can have default values.
- Functions can take positional arguments, keyword arguments, and variable length arguments. Parameters are passed by reference, so changes inside the function also affect the variables outside.
- Anonymous functions called lambdas are small single expression functions defined with the lambda keyword. They do not have a name and cannot contain multiple expressions or statements.
This document discusses functions in Python. It defines what a function is and provides the basic syntax for defining a function using the def keyword. It also covers function parameters, including required, keyword, default, and variable-length arguments. The document explains how to call functions and discusses pass by reference vs pass by value. Additionally, it covers anonymous functions, function scope, and global vs local variables.
This document discusses pointers in C programming. It defines pointers as variables that store the address of another variable. It explains that pointers use the & operator to get the address of a variable and the * operator to dereference a pointer and access the value of the variable being pointed to. The document also discusses pointer arithmetic, where incrementing or decrementing a pointer moves it to the next or previous memory location. It provides an example using a float array to demonstrate pointer arithmetic and updating array elements through a pointer.
Introduction to pointers and memory management in CUri Dekel
The document is an introduction to pointers and memory management in C. It discusses computer memory, how variables and function calls are implemented, and introduces pointers as a way to overcome limitations of passing arguments by value. It covers pointer arithmetic, arrays, and dynamic memory allocation using malloc and free. The goal is to help understand concepts and techniques while noting caveats.
1. The document discusses pointers in C including declaring and initializing pointer variables, pointer operators like & and *, calling functions by reference using pointers, pointer arithmetic, and the relationship between pointers and arrays.
2. Key topics covered include using pointers to simulate call-by-reference, dereferencing pointers with *, taking addresses of variables with &, and implementing a bubble sort using pointers passed as arguments.
3. Pointer arithmetic allows incrementing, decrementing, adding/subtracting integers to pointers, and comparing pointers.
The document provides an introduction to functions in Python. It begins by explaining that a function is a block of code that runs when called. It then discusses how functions can take in parameters and return values. The document walks through examples of creating, calling, and writing functions. It also covers topics like default parameter values, arbitrary arguments, and using a main function.
Functions allow programmers to organize code into reusable blocks. A function is defined using the def keyword and can accept parameters. The body of a function contains a set of statements that run when the function is called. Functions can return values and allow code to be reused, reducing errors and improving readability. Parameters allow information to be passed into functions, while return values allow functions to provide results.
Python programming - Functions and list and tuplesMalligaarjunanN
- A function is a block of reusable code that takes in parameters, performs an action, and returns a value. Functions provide modularity and code reusability.
- Functions in Python are defined using the def keyword followed by the function name and parameters in parentheses. The code block is indented and can return a value. Parameters can have default values.
- Functions can take positional arguments, keyword arguments, and variable length arguments. Parameters are passed by reference, so changes inside the function also affect the variables outside.
- Anonymous functions called lambdas are small single expression functions defined with the lambda keyword. They do not have a name and cannot contain multiple expressions or statements.
This document discusses functions in Python. It defines what a function is and provides the basic syntax for defining a function using the def keyword. It also covers function parameters, including required, keyword, default, and variable-length arguments. The document explains how to call functions and discusses pass by reference vs pass by value. Additionally, it covers anonymous functions, function scope, and global vs local variables.
The document discusses functions in Python. It defines what functions are, how to define functions, pass arguments to functions, return values from functions, and scope of objects in functions. It covers built-in functions, when to write your own functions, and different types of arguments like required arguments, keyword arguments, default arguments, and variable-length arguments. It also discusses how functions communicate with their environment through parameters and arguments, and pass-by-reference vs pass-by-value in Python functions.
The document discusses Python functions. It defines functions as reusable blocks of code that can be called anywhere in a program. Some key points covered include:
- Functions allow code reuse and make programs easier to understand by splitting them into logical blocks.
- There are built-in and user-defined functions. User-defined functions are defined using the def keyword followed by the function name and parameters.
- Functions can take arguments, have default values, and return values. They improve readability and maintainability of large Python programs.
The document discusses functions in programming. It defines functions as named blocks of code that perform tasks. Functions help break programs into smaller, reusable chunks. There are built-in functions included with languages like Python as well as user-defined functions. Functions make programs more organized and modular by allowing code to be reused and shared across the program. Parameters and arguments are used to pass information into functions.
This document discusses functions in Python. It defines functions as collections of statements that perform specific tasks. There are three types of functions: built-in functions, module functions, and user-defined functions. Built-in functions are predefined in Python, module functions are contained in .py files, and user-defined functions are created by the user. The document provides examples of various types of functions and how they can be called and used.
This document discusses functions in Python. It defines what a function is and explains that functions provide modularity and code reusability. It then covers function definition elements like the def keyword, parameters, return statement, and docstring. Next, it discusses calling functions and different argument types like default arguments, variable arguments, and keyword arguments. It also covers scope of variables and anonymous functions. Finally, it provides examples of illustrative programs that use functions, like calculating distance between points and checking for a leap year.
Dive into Python Functions Fundamental Concepts.pdfSudhanshiBakre1
This document discusses Python functions, including how to define functions with parameters, return values, and docstrings. It covers calling functions and passing arguments, including positional and keyword arguments. The document also discusses built-in functions, user-defined functions, and when to use functions to improve code modularity, reusability, and simplify complex tasks. Tips are provided such as keeping functions short, using descriptive names, testing functions, and taking advantage of features like default arguments.
Chapter Functions for grade 12 computer ScienceKrithikaTM
1. A function is a block of code that performs a specific task and can be called anywhere in a program. Functions make code reusable, improve modularity, and make programs easier to understand.
2. There are three main types of functions: built-in functions, functions defined in modules, and user-defined functions. Built-in functions are pre-defined and always available, module functions require importing, and user-defined functions are created by programmers.
3. Functions improve code organization and readability by separating code into logical, modular units. Functions can take parameters, return values, and be called from other parts of a program or other functions. This allows for code reuse and modular programming.
Functions allow programmers to organize code into reusable units and divide large programs into smaller, more manageable parts. The document discusses key concepts related to functions in Python like defining and calling user-defined functions, passing arguments, scope, and recursion. It provides examples of different types of functions and how concepts like mutability impact parameter passing. Functions are a fundamental part of modular and readable program design.
The document provides information on Python functions including defining, calling, passing arguments to, and scoping of functions. Some key points covered:
- Functions allow for modular and reusable code. User-defined functions in Python are defined using the def keyword.
- Functions can take arguments, have docstrings, and use return statements. Arguments are passed by reference in Python.
- Functions can be called by name and arguments passed positionally or by keyword. Default and variable arguments are also supported.
- Anonymous lambda functions can take arguments and return an expression.
- Variables in a function have local scope while global variables defined outside a function can be accessed anywhere. The global keyword is used to modify global variables from within a function
The document provides information on Python functions including defining, calling, passing arguments to, and scoping of functions. Some key points covered:
- Functions allow for modular and reusable code. User-defined functions in Python are defined using the def keyword.
- Functions can take arguments, have docstrings, and use return statements. Arguments are passed by reference in Python.
- Functions can be called by name and arguments passed positionally or by keyword. Default and variable arguments are also supported.
- Anonymous lambda functions can take arguments and return an expression.
- Variables in a function have local scope while global variables defined outside a function can be accessed anywhere. The global keyword is used to modify global variables from within a function
Functions allow for code reusability and modularity by defining reusable blocks of code. A function is defined using the def keyword followed by the function name and parameters. Functions can take in arguments and return values. There are different types of arguments like default arguments, keyword arguments, positional arguments, and arbitrary arguments. Functions improve efficiency and reduce errors through code reuse.
This document discusses functions and modular programming in C++. It defines what a function is and explains that functions allow dividing code into separate and reusable tasks. It covers function declarations, definitions, parameters, return types, and calling functions. It also discusses different ways of passing arguments to functions: call by value, call by pointer, and call by reference. Finally, it provides an example program that calculates addition and subtraction using different functions called within the main function. Modular programming is also summarized as dividing a program into independent and reusable modules to reduce complexity, decrease duplication, improve collaboration and testing.
This document discusses functions in C programming. It defines functions as a group of statements that perform a specific task and have a name. Main functions must be included in every C program as it is where program execution begins. Functions help facilitate modular programming by dividing programs into smaller parts. Functions can be user-defined or built-in library functions. Parameters can be passed to functions by value or by reference. Functions can call themselves through recursion. Variables have different storage classes like auto, register, static, and external that determine scope and lifetime.
Functions allow programmers to organize and reuse code. Defining a function involves using the def keyword followed by the function name and parameters. Functions create a new local scope, and variables are searched in local, then global, then built-in scopes. Arguments passed to functions are assigned to parameter variables in the local scope. Functions can return values, and mutable objects like lists can be modified in-place by functions. Python also supports anonymous lambda functions defined with a single expression.
Functions allow for code reusability and modularization. A function is defined using the def keyword followed by the function name and parameters. Functions can take in arguments as inputs and return a value. Variables declared inside a function have local scope while those outside have global scope. Default parameter values can be specified in the function definition.
The document discusses functions in Python. It introduces functions as a way to divide large programs into smaller, more manageable units called functions. Functions allow code to be reused by calling or invoking the function from different parts of a program. The document then covers key concepts related to functions like arguments, parameters, scope, recursion, and more. It provides examples to illustrate different types of functions and how concepts like scope, recursion, and argument passing work.
This document discusses functions in C programming. It defines a function as a self-contained block of statements that performs a specific task. Functions have a unique name, receive values from the calling program, may return a value, and are independent and reusable. There are two types of functions: predefined/standard library functions and user-defined functions. The document outlines the advantages of using functions and modular design. It also explains function declarations, definitions, parameters, scope, and how to define and call user-defined functions in C using both call-by-value and call-by-reference parameter passing.
This document provides an overview of functions in C++. It defines what a function is, how to declare and define functions, how to call functions, and the differences between passing arguments by value versus by reference. A function is a block of code that performs a specific task. Functions are declared with a return type and parameter list, and defined with a body of code. Arguments can be passed into functions either by value, where the function receives a copy of the argument, or by reference, where any changes to the argument are reflected in the original variable. Well-designed programs use modular functions to organize code into reusable components.
C functions can be defined separately from objects, require function prototypes, and always pass parameters by copy rather than by reference. Function definitions specify the return type, name, and parameter list. Parameters are local variables within the function. Global variables can be accessed across files using extern declarations. Variables have block-level scope defined by curly braces. Header files contain common function prototypes and declarations to share across files.
Abhay Bhutada, the Managing Director of Poonawalla Fincorp Limited, is an accomplished leader with over 15 years of experience in commercial and retail lending. A Qualified Chartered Accountant, he has been pivotal in leveraging technology to enhance financial services. Starting his career at Bank of India, he later founded TAB Capital Limited and co-founded Poonawalla Finance Private Limited, emphasizing digital lending. Under his leadership, Poonawalla Fincorp achieved a 'AAA' credit rating, integrating acquisitions and emphasizing corporate governance. Actively involved in industry forums and CSR initiatives, Abhay has been recognized with awards like "Young Entrepreneur of India 2017" and "40 under 40 Most Influential Leader for 2020-21." Personally, he values mindfulness, enjoys gardening, yoga, and sees every day as an opportunity for growth and improvement.
Falcon stands out as a top-tier P2P Invoice Discounting platform in India, bridging esteemed blue-chip companies and eager investors. Our goal is to transform the investment landscape in India by establishing a comprehensive destination for borrowers and investors with diverse profiles and needs, all while minimizing risk. What sets Falcon apart is the elimination of intermediaries such as commercial banks and depository institutions, allowing investors to enjoy higher yields.
The document discusses functions in Python. It defines what functions are, how to define functions, pass arguments to functions, return values from functions, and scope of objects in functions. It covers built-in functions, when to write your own functions, and different types of arguments like required arguments, keyword arguments, default arguments, and variable-length arguments. It also discusses how functions communicate with their environment through parameters and arguments, and pass-by-reference vs pass-by-value in Python functions.
The document discusses Python functions. It defines functions as reusable blocks of code that can be called anywhere in a program. Some key points covered include:
- Functions allow code reuse and make programs easier to understand by splitting them into logical blocks.
- There are built-in and user-defined functions. User-defined functions are defined using the def keyword followed by the function name and parameters.
- Functions can take arguments, have default values, and return values. They improve readability and maintainability of large Python programs.
The document discusses functions in programming. It defines functions as named blocks of code that perform tasks. Functions help break programs into smaller, reusable chunks. There are built-in functions included with languages like Python as well as user-defined functions. Functions make programs more organized and modular by allowing code to be reused and shared across the program. Parameters and arguments are used to pass information into functions.
This document discusses functions in Python. It defines functions as collections of statements that perform specific tasks. There are three types of functions: built-in functions, module functions, and user-defined functions. Built-in functions are predefined in Python, module functions are contained in .py files, and user-defined functions are created by the user. The document provides examples of various types of functions and how they can be called and used.
This document discusses functions in Python. It defines what a function is and explains that functions provide modularity and code reusability. It then covers function definition elements like the def keyword, parameters, return statement, and docstring. Next, it discusses calling functions and different argument types like default arguments, variable arguments, and keyword arguments. It also covers scope of variables and anonymous functions. Finally, it provides examples of illustrative programs that use functions, like calculating distance between points and checking for a leap year.
Dive into Python Functions Fundamental Concepts.pdfSudhanshiBakre1
This document discusses Python functions, including how to define functions with parameters, return values, and docstrings. It covers calling functions and passing arguments, including positional and keyword arguments. The document also discusses built-in functions, user-defined functions, and when to use functions to improve code modularity, reusability, and simplify complex tasks. Tips are provided such as keeping functions short, using descriptive names, testing functions, and taking advantage of features like default arguments.
Chapter Functions for grade 12 computer ScienceKrithikaTM
1. A function is a block of code that performs a specific task and can be called anywhere in a program. Functions make code reusable, improve modularity, and make programs easier to understand.
2. There are three main types of functions: built-in functions, functions defined in modules, and user-defined functions. Built-in functions are pre-defined and always available, module functions require importing, and user-defined functions are created by programmers.
3. Functions improve code organization and readability by separating code into logical, modular units. Functions can take parameters, return values, and be called from other parts of a program or other functions. This allows for code reuse and modular programming.
Functions allow programmers to organize code into reusable units and divide large programs into smaller, more manageable parts. The document discusses key concepts related to functions in Python like defining and calling user-defined functions, passing arguments, scope, and recursion. It provides examples of different types of functions and how concepts like mutability impact parameter passing. Functions are a fundamental part of modular and readable program design.
The document provides information on Python functions including defining, calling, passing arguments to, and scoping of functions. Some key points covered:
- Functions allow for modular and reusable code. User-defined functions in Python are defined using the def keyword.
- Functions can take arguments, have docstrings, and use return statements. Arguments are passed by reference in Python.
- Functions can be called by name and arguments passed positionally or by keyword. Default and variable arguments are also supported.
- Anonymous lambda functions can take arguments and return an expression.
- Variables in a function have local scope while global variables defined outside a function can be accessed anywhere. The global keyword is used to modify global variables from within a function
The document provides information on Python functions including defining, calling, passing arguments to, and scoping of functions. Some key points covered:
- Functions allow for modular and reusable code. User-defined functions in Python are defined using the def keyword.
- Functions can take arguments, have docstrings, and use return statements. Arguments are passed by reference in Python.
- Functions can be called by name and arguments passed positionally or by keyword. Default and variable arguments are also supported.
- Anonymous lambda functions can take arguments and return an expression.
- Variables in a function have local scope while global variables defined outside a function can be accessed anywhere. The global keyword is used to modify global variables from within a function
Functions allow for code reusability and modularity by defining reusable blocks of code. A function is defined using the def keyword followed by the function name and parameters. Functions can take in arguments and return values. There are different types of arguments like default arguments, keyword arguments, positional arguments, and arbitrary arguments. Functions improve efficiency and reduce errors through code reuse.
This document discusses functions and modular programming in C++. It defines what a function is and explains that functions allow dividing code into separate and reusable tasks. It covers function declarations, definitions, parameters, return types, and calling functions. It also discusses different ways of passing arguments to functions: call by value, call by pointer, and call by reference. Finally, it provides an example program that calculates addition and subtraction using different functions called within the main function. Modular programming is also summarized as dividing a program into independent and reusable modules to reduce complexity, decrease duplication, improve collaboration and testing.
This document discusses functions in C programming. It defines functions as a group of statements that perform a specific task and have a name. Main functions must be included in every C program as it is where program execution begins. Functions help facilitate modular programming by dividing programs into smaller parts. Functions can be user-defined or built-in library functions. Parameters can be passed to functions by value or by reference. Functions can call themselves through recursion. Variables have different storage classes like auto, register, static, and external that determine scope and lifetime.
Functions allow programmers to organize and reuse code. Defining a function involves using the def keyword followed by the function name and parameters. Functions create a new local scope, and variables are searched in local, then global, then built-in scopes. Arguments passed to functions are assigned to parameter variables in the local scope. Functions can return values, and mutable objects like lists can be modified in-place by functions. Python also supports anonymous lambda functions defined with a single expression.
Functions allow for code reusability and modularization. A function is defined using the def keyword followed by the function name and parameters. Functions can take in arguments as inputs and return a value. Variables declared inside a function have local scope while those outside have global scope. Default parameter values can be specified in the function definition.
The document discusses functions in Python. It introduces functions as a way to divide large programs into smaller, more manageable units called functions. Functions allow code to be reused by calling or invoking the function from different parts of a program. The document then covers key concepts related to functions like arguments, parameters, scope, recursion, and more. It provides examples to illustrate different types of functions and how concepts like scope, recursion, and argument passing work.
This document discusses functions in C programming. It defines a function as a self-contained block of statements that performs a specific task. Functions have a unique name, receive values from the calling program, may return a value, and are independent and reusable. There are two types of functions: predefined/standard library functions and user-defined functions. The document outlines the advantages of using functions and modular design. It also explains function declarations, definitions, parameters, scope, and how to define and call user-defined functions in C using both call-by-value and call-by-reference parameter passing.
This document provides an overview of functions in C++. It defines what a function is, how to declare and define functions, how to call functions, and the differences between passing arguments by value versus by reference. A function is a block of code that performs a specific task. Functions are declared with a return type and parameter list, and defined with a body of code. Arguments can be passed into functions either by value, where the function receives a copy of the argument, or by reference, where any changes to the argument are reflected in the original variable. Well-designed programs use modular functions to organize code into reusable components.
C functions can be defined separately from objects, require function prototypes, and always pass parameters by copy rather than by reference. Function definitions specify the return type, name, and parameter list. Parameters are local variables within the function. Global variables can be accessed across files using extern declarations. Variables have block-level scope defined by curly braces. Header files contain common function prototypes and declarations to share across files.
Abhay Bhutada, the Managing Director of Poonawalla Fincorp Limited, is an accomplished leader with over 15 years of experience in commercial and retail lending. A Qualified Chartered Accountant, he has been pivotal in leveraging technology to enhance financial services. Starting his career at Bank of India, he later founded TAB Capital Limited and co-founded Poonawalla Finance Private Limited, emphasizing digital lending. Under his leadership, Poonawalla Fincorp achieved a 'AAA' credit rating, integrating acquisitions and emphasizing corporate governance. Actively involved in industry forums and CSR initiatives, Abhay has been recognized with awards like "Young Entrepreneur of India 2017" and "40 under 40 Most Influential Leader for 2020-21." Personally, he values mindfulness, enjoys gardening, yoga, and sees every day as an opportunity for growth and improvement.
Falcon stands out as a top-tier P2P Invoice Discounting platform in India, bridging esteemed blue-chip companies and eager investors. Our goal is to transform the investment landscape in India by establishing a comprehensive destination for borrowers and investors with diverse profiles and needs, all while minimizing risk. What sets Falcon apart is the elimination of intermediaries such as commercial banks and depository institutions, allowing investors to enjoy higher yields.
Financial Assets: Debit vs Equity Securities.pptxWrito-Finance
financial assets represent claim for future benefit or cash. Financial assets are formed by establishing contracts between participants. These financial assets are used for collection of huge amounts of money for business purposes.
Two major Types: Debt Securities and Equity Securities.
Debt Securities are Also known as fixed-income securities or instruments. The type of assets is formed by establishing contracts between investor and issuer of the asset.
• The first type of Debit securities is BONDS. Bonds are issued by corporations and government (both local and national government).
• The second important type of Debit security is NOTES. Apart from similarities associated with notes and bonds, notes have shorter term maturity.
• The 3rd important type of Debit security is TRESURY BILLS. These securities have short-term ranging from three months, six months, and one year. Issuer of such securities are governments.
• Above discussed debit securities are mostly issued by governments and corporations. CERTIFICATE OF DEPOSITS CDs are issued by Banks and Financial Institutions. Risk factor associated with CDs gets reduced when issued by reputable institutions or Banks.
Following are the risk attached with debt securities: Credit risk, interest rate risk and currency risk
There are no fixed maturity dates in such securities, and asset’s value is determined by company’s performance. There are two major types of equity securities: common stock and preferred stock.
Common Stock: These are simple equity securities and bear no complexities which the preferred stock bears. Holders of such securities or instrument have the voting rights when it comes to select the company’s board of director or the business decisions to be made.
Preferred Stock: Preferred stocks are sometime referred to as hybrid securities, because it contains elements of both debit security and equity security. Preferred stock confers ownership rights to security holder that is why it is equity instrument
<a href="https://www.writofinance.com/equity-securities-features-types-risk/" >Equity securities </a> as a whole is used for capital funding for companies. Companies have multiple expenses to cover. Potential growth of company is required in competitive market. So, these securities are used for capital generation, and then uses it for company’s growth.
Concluding remarks
Both are employed in business. Businesses are often established through debit securities, then what is the need for equity securities. Companies have to cover multiple expenses and expansion of business. They can also use equity instruments for repayment of debits. So, there are multiple uses for securities. As an investor, you need tools for analysis. Investment decisions are made by carefully analyzing the market. For better analysis of the stock market, investors often employ financial analysis of companies.
OJP data from firms like Vicinity Jobs have emerged as a complement to traditional sources of labour demand data, such as the Job Vacancy and Wages Survey (JVWS). Ibrahim Abuallail, PhD Candidate, University of Ottawa, presented research relating to bias in OJPs and a proposed approach to effectively adjust OJP data to complement existing official data (such as from the JVWS) and improve the measurement of labour demand.
The Rise of Generative AI in Finance: Reshaping the Industry with Synthetic DataChampak Jhagmag
In this presentation, we will explore the rise of generative AI in finance and its potential to reshape the industry. We will discuss how generative AI can be used to develop new products, combat fraud, and revolutionize risk management. Finally, we will address some of the ethical considerations and challenges associated with this powerful technology.
In a tight labour market, job-seekers gain bargaining power and leverage it into greater job quality—at least, that’s the conventional wisdom.
Michael, LMIC Economist, presented findings that reveal a weakened relationship between labour market tightness and job quality indicators following the pandemic. Labour market tightness coincided with growth in real wages for only a portion of workers: those in low-wage jobs requiring little education. Several factors—including labour market composition, worker and employer behaviour, and labour market practices—have contributed to the absence of worker benefits. These will be investigated further in future work.
Seminar: Gender Board Diversity through Ownership NetworksGRAPE
Seminar on gender diversity spillovers through ownership networks at FAME|GRAPE. Presenting novel research. Studies in economics and management using econometrics methods.
STREETONOMICS: Exploring the Uncharted Territories of Informal Markets throug...sameer shah
Delve into the world of STREETONOMICS, where a team of 7 enthusiasts embarks on a journey to understand unorganized markets. By engaging with a coffee street vendor and crafting questionnaires, this project uncovers valuable insights into consumer behavior and market dynamics in informal settings."
Independent Study - College of Wooster Research (2023-2024) FDI, Culture, Glo...AntoniaOwensDetwiler
"Does Foreign Direct Investment Negatively Affect Preservation of Culture in the Global South? Case Studies in Thailand and Cambodia."
Do elements of globalization, such as Foreign Direct Investment (FDI), negatively affect the ability of countries in the Global South to preserve their culture? This research aims to answer this question by employing a cross-sectional comparative case study analysis utilizing methods of difference. Thailand and Cambodia are compared as they are in the same region and have a similar culture. The metric of difference between Thailand and Cambodia is their ability to preserve their culture. This ability is operationalized by their respective attitudes towards FDI; Thailand imposes stringent regulations and limitations on FDI while Cambodia does not hesitate to accept most FDI and imposes fewer limitations. The evidence from this study suggests that FDI from globally influential countries with high gross domestic products (GDPs) (e.g. China, U.S.) challenges the ability of countries with lower GDPs (e.g. Cambodia) to protect their culture. Furthermore, the ability, or lack thereof, of the receiving countries to protect their culture is amplified by the existence and implementation of restrictive FDI policies imposed by their governments.
My study abroad in Bali, Indonesia, inspired this research topic as I noticed how globalization is changing the culture of its people. I learned their language and way of life which helped me understand the beauty and importance of cultural preservation. I believe we could all benefit from learning new perspectives as they could help us ideate solutions to contemporary issues and empathize with others.
2. Python Functions
• In Python, a function is a group of related statements that
performs a specific task.
• Functions help break our program into smaller and modular
chunks. As our program grows larger and larger, functions make it
more organized and manageable.
• Furthermore, it avoids repetition and makes the code reusable.
4. Above shown is a function definition that consists of the
following components.
• Keyword def that marks the start of the function header.
• A function name to uniquely identify the function. Function
naming follows the same rules of writing identifiers in
Python.
• Parameters (arguments) through which we pass values to
a function. They are optional.
5. • A colon (:) to mark the end of the function header.
• Optional documentation string (docstring) to describe
what the function does.
• One or more valid python statements that make up the
function body. Statements must have the same
indentation level (usually 4 spaces).
• An optional return statement to return a value from the
function.
6. Example of a function
def display(name):
"""
This function displays the name of the
person passed in as
a parameter
"""
print("Hello, " + name + ". Good morning!")
7. How to call a function in python?
• Once we have defined a function, we can call it from
another function, program, or even the Python prompt.
• To call a function we simply type the function name with
appropriate parameters.
• Syntax:
>>> display('abc')
8. Note: In python, the function definition should
always be present before the function call.
Otherwise, we will get an error.
9. Docstring
• The first string after the function header is called the
docstring and is short for documentation string. It is briefly
used to explain what a function does.
• In the above example, we have a docstring immediately
below the function header. We generally use triple quotes
so that docstring can extend up to multiple lines. This
string is available to us as the __doc__ attribute of the
function.
10. The return statement
• The return statement is used to exit a function and go
back to the place from where it was called.
• Syntax of return:
return [expression_list]
11. • This statement can contain an expression that gets
evaluated and the value is returned.
• If there is no expression in the statement or the return
statement itself is not present inside a function, then the
function will return the None object.
12. Example (Return)
def absolute_value(num):
"""This function returns the absolute
value of the entered number"""
if num >= 0:
return num
else:
return -num
print(absolute_value(2))
print(absolute_value(-4))
14. Parameters
• A parameter is the variable defined within the parentheses
during function definition.
• Simply they are written when we declare a function.
• Example:
# Here a,b are the parameters
def sum(a,b):
print(a+b)
sum(1,2)
15. Arguments
• An argument is a value that is passed to a function when
it is called. It might be a variable, value or object passed
to a function or method as input. They are written when
we are calling the function.
• Example:
def sum(a,b):
print(a+b)
# Here the values 1,2 are arguments
sum(1,2)
16. Note
• If any functions is having two parameters and we have
called that function with two arguments, then it will run
smoothly.
• But if a function is havinng two parameters and we are
calling that function with just one argument then it will give
error.
• Hence there shouldn’t be difference in number of
parameters and arguments while calling the function.
17. Variable Function Arguments
• Up until now, functions had a fixed number of arguments.
In Python, there are other ways to define a function that
can take variable number of arguments.
• Three different forms of this type are described below:
1. Python Default Arguments
2. Python Keyword Arguments
3. Python Arbitrary Arguments
18. Python Default Arguments
• Function arguments can have default values in Python.
• We can provide a default value to an argument by using
the assignment operator (=).
• Here is an example.
19. Example
def greet(name, msg="Good morning!"):
"""
This function greets to the person with the
provided message.
If the message is not provided,it defaults to "Goodmorning!"
"""
print("Hello", name + ', ' + msg)
greet("Kate")
greet("Bruce", "How do you do?")
20. • In this function, the parameter name does not have a default
value and is required (mandatory) during a call.
• On the other hand, the parameter msg has a default value of
"Good morning!". So, it is optional during a call. If a value is
provided, it will overwrite the default value.
• Any number of arguments in a function can have a default value.
But once we have a default argument, all the arguments to its
right must also have default values.
21. • This means to say, non-default arguments cannot follow
default arguments. For example, if we had defined the
function header above as:
def greet(msg = "Good morning!", name):
• You will get an error.
22. Python Keyword Arguments
• When we call a function with some values, these values
get assigned to the arguments according to their position.
• For example, in the above function greet(), when we
called it as greet("Bruce", "How do you do?"), the value
"Bruce" gets assigned to the argument name and similarly
"How do you do?" to msg.
23. • Python allows functions to be called using keyword arguments.
When we call functions in this way, the order (position) of the
arguments can be changed. Following calls to the above function
are all valid and produce the same result.
• # 2 keyword arguments
• greet(name = "Bruce",msg = "How do you do?")
• # 2 keyword arguments (out of order)
• greet(msg = "How do you do?",name = "Bruce")
• 1 positional, 1 keyword argument
• greet("Bruce", msg = "How do you do?")
24. • As we can see, we can mix positional arguments with keyword
arguments during a function call. But we must keep in mind that
keyword arguments must follow positional arguments.
• Having a positional argument after keyword arguments will result
in errors. For example, the function call as follows:
greet(name="Bruce","How do you do?")
25. Python Arbitrary Arguments
• Sometimes, we do not know in advance the number of
arguments that will be passed into a function. Python
allows us to handle this kind of situation through function
calls with an arbitrary number of arguments.
• In the function definition, we use an asterisk (*) before the
parameter name to denote this kind of argument.
26. Example
def greet(*names):
"""This function greets all
the person in the names tuple."""
# names is a tuple with arguments
for name in names:
print("Hello", name)
greet("Monica", "Luke", "Steve", "John")
27. • Here, we have called the function with multiple
arguments. These arguments get wrapped up into a tuple
before being passed into the function. Inside the function,
we use a for loop to retrieve all the arguments back.
28. Scope of Variables
• All variables in a program may not be accessible at all
locations in that program. This depends on where you
have declared a variable.
• The scope of a variable determines the portion of the
program where you can access a particular identifier.
There are two basic scopes of variables in Python −
• Global variables
• Local variables
29. Local Variables
• Local variables are those which are initialized inside a function
and belong only to that particular function. It cannot be accessed
anywhere outside the function. Let’s see how to create a local
variable.
• Example:
def f():
# local variable
s = "python"
print(s)
# Driver code
f()
30. • If we will try to use this local variable outside the function
then let’s see what will happen.
• Example:
def f():
# local variable
s = "python"
print("Inside Function:", s)
f()
print(s)
• An error message will be there because ‘s’ is not defined in the scope.
31. Global Variables
• These are those which are defined outside any function
and which are accessible throughout the program, i.e.,
inside and outside of every function. Let’s see how to
create a global variable.
• Example: Defining and accessing global variables
32. Example
# This function uses global variable s
def f():
print("Inside Function", s)
# Global scope
s = "python"
f()
print("Outside Function", s)
• The variable s is defined as the global variable and is used both inside the
function as well as outside the function.
33. • Note: As there are no locals, the value from the globals
will be used but make sure both the local and the global
variables should have same name.
• Now, what if there is a variable with the same name
initialized inside a function as well as globally. Let’s see
that with help of an example.
34. Example
# This function has a variable with
# name same as s.
def f():
s = "class"
print(s)
# Global scope
s = "python"
f()
print(s)
35. • If a variable with the same name is defined inside the
scope of function as well then it will print the value given
inside the function only and not the global value.
• The question is, what if we try to change the value of a
global variable inside the function. Let’s see it using the
below example.
36. Example
# This function uses global variable s
def f():
s += 'class'
print("Inside Function", s)
# Global scope
s = "python"
f()
OUTPUT:
UnboundLocalError: local variable 's' referenced before assignment
• To make the above program work, we need to use the “global” keyword.
37. • We only need to use the global keyword in a function if we want to
do assignments or change the global variable. global is not
needed for printing and accessing.
• Python “assumes” that we want a local variable due to the
assignment to s inside of f(), so the first statement throws the
error message.
• Any variable which is changed or created inside of a function is
local if it hasn’t been declared as a global variable. To tell Python,
that we want to use the global variable, we have to use the
keyword “global”, as can be seen in the upcoming example:
38. Example Using global keyword
# This function modifies the global variable 's'
def f():
global s
s += 'class'
print(s)
s = "new python"
print(s)
# Global Scope
s = "Python"
f()
print(s)
41. Anonymous/Lambda Function
• In Python, an anonymous function is a function that is defined
without a name.
• While normal functions are defined using the def keyword in
Python, anonymous functions are defined using the lambda
keyword.
• Hence, anonymous functions are also called lambda functions.
42. Syntax of lamba function
• Syntax:
lambda arguments: expression
• Lambda functions can have any number of arguments but
only one expression. The expression is evaluated and
returned. Lambda functions can be used wherever
function objects are required.
43. Example
# Program to show the use of lambda functions
double = lambda x: x * 2
print(double(5))
44. • In the above program, lambda x: x * 2 is the lambda
function. Here x is the argument and x * 2 is the
expression that gets evaluated and returned.
• This function has no name. It returns a function object
which is assigned to the identifier double. We can now
call it as a normal function.
45. double = lambda x: x * 2
is nearly the same as:
def double(x):
return x * 2
46. Use of Lambda Function in python
• We use lambda functions when we require a nameless
function for a short period of time.
• In Python, we generally use it as an argument to a higher-
order function (a function that takes in other functions as
arguments). Lambda functions are used along with built-in
functions like filter(), map() etc.
47. use with filter()
• The filter() function in Python takes in a function and a list as
arguments.
• The function is called with all the items in the list and a new list is
returned which contains items for which the function evaluates to
True.
• Here is an example use of filter() function to filter out only even
numbers from a list.
48. Example
# Program to filter out only the even items from a list
my_list = [1, 5, 4, 6, 8, 11, 3, 12]
new_list = list(filter(lambda x: (x%2 == 0) , my_list))
print(new_list)
49. use with map()
• The map() function in Python takes in a function and a list.
• The function is called with all the items in the list and a
new list is returned which contains items returned by that
function for each item.
• Here is an example use of map() function to double all the
items in a list.
50. Example
# Program to double each item in a list using map()
my_list = [1, 5, 4, 6, 8, 11, 3, 12]
new_list = list(map(lambda x: x * 2 , my_list))
print(new_list)
51. Function within Functions
• A function that is defined inside another function is known
as the inner function or nested function.
• Nested functions are able to access variables of the
enclosing scope.
• Inner functions are used so that they can be protected
from everything happening outside the function.
52. Example
# Python program to
# demonstrate accessing of
# variables of nested functions
def f1():
s = 'I love GeeksforGeeks'
def f2():
print(s)
f2()
# Driver's code
f1()
54. Type Conversion
• Type Conversion, just as the name suggests, is the process of
converting the type of objects from one data type into another as
per requirement.
• Python supports various built-in type conversion functions such as
int(), long(), float(), str() etc,.
• This type of conversion is also called as Explicit Type Conversion
or Type Casting.
55. • When a user will try to add a string and an integer, Since
python does not allow a string and an integer to be added,
both should be converted to the same data type.
Therefore, we explicitly convert string b to int datatype
(int(b)).
• It is worth to keep in mind that in Explicit Type
Conversion, there may be chances of data loss as we
enforce an object to a specified datatype.
56. Type Coercion
• The automatic type conversion from one data type to
another is called as Type Coercion. This is also called as
Implicit Type Conversion.
• The major difference between Type Conversion and Type
Coercion is that, type conversion is done manually using
built-in functions where as type coercion is done
automatically.
57. • For example, a is an integer and the data type of b is
float. When the two are added, we can see that the result
has a datatype of float. This is because, python always
converts smaller datatypes to larger data types in order to
avoid loss of data.
59. Recursion
• Recursion is the process of defining something in terms of
itself.
• In Python, we know that a function can call other
functions. It is even possible for the function to call itself.
These types of construct are termed as recursive
functions.
• A function is called recursive if a statement within the
body of the function calls the same function.
62. • When we call this function with a positive integer, it will
recursively call itself by decreasing the number.
• Each function multiplies the number with the factorial of
the number below it until it is equal to one.
64. • Our recursion ends when the number reduces to 1. This is called the base
condition.
• Every recursive function must have a base condition that stops the recursion
or else the function calls itself infinitely.
• The Python interpreter limits the depths of recursion to help avoid infinite
recursions, resulting in stack overflows.
• By default, the maximum depth of recursion is 1000. If the limit is crossed, it
results in RecursionError.
66. Advantages of Recursion
• Recursive functions make the code look clean and
elegant.
• A complex task can be broken down into simpler sub-
problems using recursion.
• Sequence generation is easier with recursion than using
some nested iteration.
67. Disadvantages 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.
68. setrecursionlimit()
• The setrecursionlimit function is used to modify the default
recursion limit set by python. Using this,we can increase
the recursion limit to satisfy our needs
• Syntax:
import sys
sys.setrecursionlimit(10**6)
69. Python Modules
• Modules refer to a file containing Python statements and
definitions.
• A file containing Python code, for example: example.py, is
called a module, and its module name would be example.
• We use modules to break down large programs into small
manageable and organized files. Furthermore, modules
provide reusability of code.
70. • We can define our most used functions in a module and
import it, instead of copying their definitions into different
programs.
• Let us create a module. Type the following and save it as
sample.py.
• Here, we have defined a function Example inside a
module named sample.
71.
72. Import modules in Python
• We can import the definitions inside a module to another
module or the interactive interpreter in Python.
• We use the import keyword to do this. To import our
previously defined module sample, we type the following
in the Python prompt.
import sample
73. • This does not import the names of the functions defined in
sample directly in the current symbol table. It only imports
the module name sample there.
• Using the module name we can access the function using
the dot . operator.
sample.example()
75. Re-naming a Module
• You can create an alias when you import a module, by
using the as keyword:
import sample as s
s.Example()
76. Advantages of modules
• Reusability: Working with modules makes the code
reusability a reality.
• Simplicity: Module focuses on a small proportion of the
problem, rather than focusing on the entire problem.
• Scoping: A separate namespace is defined by a module
that helps to avoid collisions between identifiers.
77. Python from...import statement
• We can import specific names from a module without
importing the module as a whole. Here is an example.
• Example:
from sample import location
print(location)
78. • Here, we imported only the location variable from the
sample module.
• In such cases, we don't use the dot operator. We can also
import multiple attributes as follows:
from sample import location, x