Learn python programming in 5 mins
In this Blog we will learn Python programming language in 5 mins since it is one of the most versatile and popular language used in Industries as well as few advanced Processor Boards too, in this video we will cover basic python commands, identifiers, keywords and datatypes. Let’s get started.
Let us Understand what python is
Python is a general-purpose programming language.
We will Learn python programming in 5 mins
It is designed to be used for writing software in widest variety of application domain.
Python is object oriented
In object-oriented programming the programmers define the data type of a data structure, and also the type of operations that can be applied to the data structure.
Python is easily integrated with c, c++, java, etc.
Why do we need to study Python?
It is a very popular form of coding.
It’s very simple and it’s in demand. It is used in data science, artificial intelligence, web development and many more things.
These are emerging areas of technology which would help you further.
Therefore learning python is essential and important.
Downloading the the Python software
How to download the software?
follow the Download link below, Download the latest version of python. Install the setup and you are ready to go.
Syntax to display a string
Example:
print(“hello”) OR print(‘hello’)
strings can be displayed with single or double inverted commas.
To compile
Save file—> run—> run module
output is displayed in the python window shell.
Learn python programming in 5 mins
Syntax to display an integer
we can write print integers with or without inverted commas.
Example:
print(1234)
print(“1234”)
print(‘1234’)
this will give the output: 1234
What is an identifier?
An Identifier is a name given to identify a variable, function, class, module or other object.
There are a few rules for naming an identifier:
- Identifier starts with a letter or an underscore
- It cannot start with a digit
- It does not allow &,@,% and other punctuation characters.
- Python is case sensitive.
How to assign values to the variable?
With the help of = sign
Assigning values to variables can be done with the help of ‘=’ sign
Example:
Keywords
Keywords are the reserved words in python.
They define the syntax and structure .
Some of the keywords are print, import, try, else, if, while, finally, etc.
We cannot use keywords as an identifier.
Data Types
In python programming language There are 5 standard data types.
- Numbers– 4 types(int, float, long, complex)
- String– are words, sentences
- List– list of number/strings/both
- Tuple– tuples are read-only lists.
- Dictionary– these are like hash tables.
Converting the data types in python programming language
For example
From int to float
Example:
Float(12)
the output will be 12.0
For complex number
Complex(2,-8)
the output will be 2-8j
if you liked this post, you might also like this Post