Subscribe to this blog

NEWSLETTER

Search This Blog

Featured post

DevOps means a concept to bring Development team and operation team together. So that you can speed up the deployment process. Before you start learning the tools you need to understand core principles. The useful DevOps Principles to know for your project and interviewsTo deliver rapidly without affecting qualityCommunication and Collaboration are the key ideas in DevOps conceptMultiple deploys are possible- if code in Development team automatedOnce you commit the repository, it tests the code automatically against the automated test scriptsIf Build is successfully passed, it installs automatically in Testing environment When infrastructure is automated, it installs automatically to other serversMinor changes takes place in isolation, that means , it creates separate server to deploy minor changesSpeed in Devops, organizations to better serve their customers and compete more effectively in the market.Quality and Security teams are part of DevOpsAutomating the process, much better pro…

Python user defined functions real examples

In Python, user-defined functions real use is you can use in scripts You can avoid repeated work. These are very different from C/C++/JAVA. I will give you syntax and example for your quick reference and how to start learning quickly.

Python Syntax for User defined function(UDF)

Explanation of each keyword

A function name to uniquely identify it. Function naming follows the similar rules that are used for writing identifiers

List of parameters also called as a list of arguments through which value is passed to the function. The list of parameters is optional.

A colon(:) to mark the end of function header.

Optional documentation string (docstring) is used to describe the purpose of the function, which is slightly similar to python documentation using comment.

Python statements that perform the intended task for which the user-defined function is made. It is mandatory to maintain the indentation level while writing python statements in the function definition.

In the end, an optional return statement is used to return a value (result) from the function. This statement can contain an optional parameter to return the computed result back to the function call. If there is no parameter in the statement or the return statement is not mentioned at the end of function definition then the function returns the None object.

The above example is a good one. You can start learning Python UDF quickly.

Python Vs Other Languages

Python is one of the most popular languages in data analytics. There are many other languages that have an option to create UDFs. Even in SQL of any database, you can easily create user-defined functions.

Advantages of Python UDF

User-defined functions help to decompose a large program into small segments which make the program easy to understand, maintain and debug.

If repeated code occurs in a program. The function can be used to include those codes and execute when needed by calling that function.

Programmers working on the large project can divide the workload by making different functions.

Comments

Post a Comment

Most Viewed

I am practicing Hyperledger. This is one of the top listed blockchains. This architecture follows R3 Corda specifications. Sharing the interview questions with you that I have prepared for my interview.

Though Ethereum leads in the real-time applications. The latest Hyperledger version is now ready for production applications. It has now become stable for production applications.The Hyperledger now backed by IBM. But, it is still an open source. These interview questions help you to read quickly.
The below set of interview questions help you like a tutorial on Hyperledger fabric.
Hyperledger Fabric Interview Questions1). What are Nodes?
In Hyperledger the communication entities are called Nodes.

2). What are the three different types of Nodes?
- Client Node
- Peer Node
- Order Node
The Client node initiates transactions. The peer node commits the transaction. The order node guarantees the delivery.

3). What is Channel?
A channel in Hyperledger is the subnet of the main blockchain. You c…