ANONYMOUS FUNCTION (or) LAMBDA FUNCTION IV. ANONYMOUS FUNCTION (ganesh.py) 1. SOURCE CODE # anonymous function squ=lambda a: a*a # calling anonymous function k=squ(5) # print the result print(“Square is : “,k) 2….
Month: March 2023
How to use Function in Python
Python Function TYPES OF FUNCTION 1. Pre-defined function (Built-in function) 2. User defined function INVOKING FUNCTION I. FUNCTION WITH NO ARGUMENTS (test.py) 1. SOURCE CODE # creating a function def info(): print…
How to use Variables in Python – Local vs Global Variables
PYTHON VARIABLES NOTE Syntax and Example SCOPE OF THE VARIABLE 1. LOCAL VARIABLE Calling: I. EXAMPLE OF LOCAL VARIABLE (ganesh.py) 1. SOURCE CODE # defining function def disp(): # defining a local…
Hello World in Python
HELLO WORLD IN PYTHON PROGRAMMING In this tutorial, you will learn step by step examples for creating a hello world python program in windows OS using two ways. They are Using Manual…
Python Introduction for Data Science
PYTHON FEATURES OF PYTHON PYTHON FAMILY WHO USES PYTHON FIRST RELEASE PYTHON RELEASES FILE FORMAT PYTHON FLAVORS S.N IMPLEMENTATION VIRTUAL MACHINE LANGUAGE 1. CPython CPythonVM C Language 2. Jython JVM Java 3….
3 Ways Of Reversing File Contents in Linux / Unix
In this tutorial, you will learn how to reverse the file contents using three tips using linux commands. Different Ways 1. Reversing File Contents using tac command Syntax tac filename Example 2….
How to use Command Substitution in Bash Script
Shell Script Command Substitution Approach 1 Syntax variable-name=$(command expression) Example k=$(date) NOTE Approach 2 Syntax variable-name=`command expression` Example k=`date` I. EXAMPLE OF LISTING FILES AND SUB FOLDERS OF CURRENT DIRECTORY VIA COMMAND…
How to use Strings in C++
In this tutorial you will learn what is string, how to use strings in c++, c++ strings, strings in c++ with program examples. C++ Strings 1. C STYLE STRING Example 1 –…
2 Linux Tips for Decompressing File in Unix / Linux
Decompressing File in Unix / Linux using gzip and gunzip Commands Here you can find two tips to decompress the already compressed file in unix / linux terminal with examples. They are…
How to Use For Loop in Shell Script (Linux Bash)
Shell Scripting Tutorial For Loop 1. Simple for loop (Data based for loop) Syntax for variable in data do # code done Where, variable is an user defined variable. Example 1 –…