PYTHON PROGRAMMING LANGUAGE
INTRODUCTION:
Python was founded by Guido Van Rossum in the year 1991. It is an interpreted programming language meaning that the code will be executed line by line without the need of compilation. It is often termed as High-Level programming language which serves better understanding of code for both programmers and systems. Python focuses more on code readability and syntax of python helps us to write the code in fewer steps compared to other programming languages. But one thing need to remember is that python follows a strict indentation, results in errors if doesn’t followed.
Here are some of the key features which made python to stand out.
FEATURES:
- Easy to learn, use, maintain
- Free and open source
- Interactive
- High-Level, Interpreted and Object Oriented Language
- Dynamically typed
Now we discuss few of the fundamental concepts of python such as variables, datatypes and functions in Python.
VARIABLES:
In programming, variables are used to store the values in the memory. In other words variables serves as a container to hold the data values. We can assign a value to a variable by providing an assignment operator ‘=’.
Syntax:
Variable_name = Data value
a=18
greetings="hello!"
# 'a' and 'greetings' are the variables holding '18' and "hello!" respectivelyOne of the main advantage of python variables is they are ‘Dynamically Typed’ meaning that we don’t need to declare type of the variable explicitly. Based on the value the variable is decided as a particular data type.
We can know the data type of the variable by using type( ) function.
IDENTIFIERS:
These are the names which are used to identify a variable, function, class etc.
Rules:
- Identifiers should always starts with Alphabets (A-Z or a-z) or an underscore(_) and followed by letters and digits(0–9)
- They should never start with digits and must not contain any of the special characters like $,%,@ etc.
Example:
Valid identifiers
→ Name1 , _name1
Invalid identifiers
→ 123name, name$
Python Identifiers are case sensitive meaning that ‘name’ and ‘Name’ are treated as different one.
DATA TYPES:
Python has several built-in data types and are classified into categories based on the type of data value the variables store. Below is just the brief information of data types which will give you the basic knowledge.
Numerical data types:
→ int: Integer to store integer values like 10, -123, 0 etc.
→ float: Floating point decimals like 2.0, -1.6, 3.14152 etc.
Get Mudusu Manikanth Reddy’s stories in your inbox
Join Medium for free to get updates from this writer.
→ complex: Complex numbers consisting both real and imaginary parts like 2+3j, 3–5i.
Boolean type: To evaluate whether the expression is True or False. If the expression matches the condition specified it returns True, else False.
Collection type: These types are used to collect items of various data types in a sequential order. Lists, Tuples, Strings are the collection data types.
→ list[ ]: Collection of sequence of objects which are mutable.
→ tuple( ): Collection of sequence of objects which are immutable.
→ str: Used to store words or characters.
Dictionary:
→ dict { }: Used to store the items in key-value pair.
Set:
→ set{ }: Collection of objects in an unordered manner.
We can know the data type of the variable by using type( ) function.
FUNCTIONS:
Function is defined as a block of organized and reusable code which is used to perform certain task.
Defining a function: Any function will begins with def keyword followed by function name and parentheses. Required parameters should be placed inside the parentheses, in case of multiple parameters they should be separated by commas. The colon ‘:’ indicated the start of functional block.
Here is syntax for creation of function.
Syntax:
→ def function_name (parameters):
Calling a function: Just as the function definition, function call implemented by function name followed by parentheses and required arguments inside it except colon at the end.
Syntax:
→ function_name (arguments)
Parameters: These are the variables that are specified inside the function definition.
Arguments: These are the actual values to be passed when a function is called.
Return: A return statement is used to return the result to calling function and terminates the execution of program. It results none if nothing is specified in the return statement.
Example:
Types of functions:
- Built-in functions: These functions need not to be defined as they are ready to use. Ex: print( ), input( ).
- User- defined functions: These functions are defined by the user by using def keyword. Ex: def add( ):
Let’s look into some of the applications of python.
APPLICATIONS:
- Desktop, Web and Network applications
- Artificial Intelligence (AI) and Machine Learning (ML)
- Robotics, Internet of Things (IoT)
- Data science, Game development etc.



