Python Fundamentals | Most Easiest and Powerful Language in the Industry of Technology | Python Programming Series-01
We will be learning and going through the following topics of Python programming language in our 1st Python Programming article:
- Why learn Python?
- Application of Python
- Installing IDE for Python
- How simple is Python?
- Python Scripts
- Most Common Python Commands for Calculation
- Comments in Python
- Variables in Python
- Strings in Python
WHY LEARN PYTHON?
There are hundreds of programming languages in the world. Every general purpose programming language has different features and capabilities. We will see the applications of Python programming language later in the article. But for now, let's enlighten the seven golden factors which says that you should be using Python Programming language:
- Easy to learn
- Open source license
- Portable
- Large standard libraries
- High level-Interpreted language
- Extensible and Embeddable
- Object oriented language
APPLICATION OF PYTHON
Python is in the list of most demanding programming languages nowadays and for the future as well. Python is a general purpose programming language which is capable of providing tons of complex functionalities very conveniently. In the industry of computing and technology, Python is mostly used for the following purposes:
- Web Development
- Mathematics Computations
- Data Sciences
- Artificial Intelligence
- Graphical user interface Applications
INSTALLING IDE FOR PYTHON
IDE stands for Integrated Development Environment. Python does not necessarily required an IDE. Python scripts can be written on any text editor or even on notepad and run through the terminal. An IDE provides a lot more functionalities than using terminal and notepad such as debugging, coding and running at run-time, and many other tools for making your programming environment much more convenient. We will be using Python official IDE, IDLE. However, you can download and install any of the IDE from the following:- IDLE
- Wing IDE
- Pycharm IDE
- Notepad++
- Atom IDE
- Spyder IDE
HOW SIMPLE IS PYTHON?
Python is not as complex as other programming languages. It has clean and easy ways of programming. For instance if you want to add any two numbers you can simply write:- 2 + 3
And the result or output will print on the screen;
Similarly if you want to print any value either any number or a string you will simply type:
- print ("Howtechyy")
- #or
- print ('Howtechyy')
- print (5)
PYTHON SCRIPTS
Python scripting is used to avoid the same coding again and again. In Python scripting, a python program is written and saved. Now, Whenever the programmer needs to use or execute the same program or logic, script is used. For instance, type the following code in your IDE or notepad and save this file as Script.py.IN LINUX:
- #!/usr/bin/python
- print ("Hello Howtechyy")
IN WINDOWS AND MAC:
- #File: Script.py
- print ("Hello Howtechyy")
Now open up the terminal and use the script. Simple type the following without coding entire program:
- Python Script.py
MOST COMMON PYTHON COMMANDS FOR CALCULATION
abs(value) : For absolute values
ceil(value) : To round the value up
floor(value) : To round the value down
round(value) : For rounding off value
cos(value) : For Cos trigonometric values
sin(value) : For Sin trigonometric values
log(value) : For finding logarithm
log10(value) : For finding Log10
max(value1, value2) : For finding the largest value
min(value1, value2) : For finding the smallest value
sqrt(value) : For finding square root
COMMENTS IN PYTHON
Comments in Python are the statements, written between the code to make it meaningful and clear. Comments are not executable and ignored by the compiler. The syntax for inserting comment in python is as follows:- #comment
Comments in Python can be used as follows:
VARIABLES IN PYTHON
Variables are the stores for storing different kinds of values for your program. Python does not makes the program complex for a programmer. For instance, data types are not declared in the program of python instead, we can simply assign any sort of value to any kind of data. The syntax depends on the kind of value you want to declare. For instance, strings are declared in inverted comas while integer or numeric values are declared as they are.NUMERIC VALUES IN PYTHON
We can assign any numeric value to a variable as it is. The syntax for assigning numeric values in python is:- var1 = 5 (any integer value)
- var2 = 5.55 (any float value)
For example:
BONUS INFO:
It is not necessary to type print function in order to print a value, instead it is also possible to get a print output, just by typing the name of the variable(such that var1).
STRINGS IN PYTHON
There are two syntax available for the declaration of strings in Python programming language. The difference between both of the syntax is of inverted commas.- name1 = "HowTechyy"
Or strings in Python can also be declared as follows:
- name2 = 'HowTechyy'
In practice:
0 Comments
Your comments and interesting view make our day!