Hello , I am Ameer Fazal and What is Python?
Python is a programming language. It was created by Guido van Rossum. Guido van Rossum started
implementing Python as a Hobby project in 1989 christhmas holidays. Python is named
after a BBC comedy show: Monty Python’s Flying Circus.
The language is not named after this wonderful snake. To get Python, Go to www.python.org
and download and install the latest version of Python.
Python is free software. I am using Python 3.5.0.
The very latest version. Python is a simple and very powerful general purpose computer
programming language. If you want to learn programming or if you have never programmed
before, then learning Python is a very good idea. Python is very easy to learn compared
to other languages or Python programs are very readable. This is my Ubuntu GNU/Linux
operating system desktop or my desktop. To open Python, open Terminal, the command line
shell of linux. Press CONTROL, SHIFT and PLUS couple of times to zoom in the window or you
can go to the menu – View on top and click on zoom in and type python3 and hit enter
key. “>>>” is called a “chevron” and we can understand by seeing a cursor blinking
after a “chevron” that we are in the Python Interpreter. If you are on a Mac, you can
open Python from Terminal. If you are on a Windows machine, I strongly recommend for
using Python IDLE, the Integrated Development Environment of Python which is avaliable from
www.python.org. You can also use any Text Editor or any IDE of your choice.
Hello World Program This is the first program we write, when we
are learning a new programming language. This program is simply telling the computer to
display the text “Hello World!” on the screen. Type : print(‘Hello World’) and hit
Enter Key. “Hello World” should be in quotes. We can see ‘Hello World!’ printed on the screen.
Welcome to the world of Python Programming or programming in general if you have never
programmed before. In the above program line, print() is a function and ‘hello world’ is
a string. Let’s try the same print function with some other string. print(‘Hot Coffee!’)
see! Hot Coffee! is printed.
What if we want to store the Hello World program in the secondary memory or hard disk, so that
we can use it again in the future. In the terminal I am typing nano hello_world.py.
Python Program File Extension is .py. I am using a simple text editor called nano to
make the hello world program. Simply type print(‘Hello World’)
save and exit from the nano editor. To save press control and x and then press y for yes.
ls command is for listing the directory. We can see the hello_world program in the directory
or by GUI we can see the new file in the folder. I am opening it in Gedit text editor so that
you can see. I am going to execute the Python program we just wrote. Type python3 space filename.py here hello_world.py Basic Arithmetic Operations
Without Basic Arithmetic, Programming is nothing. But believe me it’s not that difficult. Let’s
open Python Interpreter again, 15 + 23 and hit Enter key. see the answer printed back.
This is arithmetic addition operation let’s do subtraction
50 – 30 the answer is 20
Multiplication 2 * 6
we use asterisk or star symbol for multiplication What if we are using **?
2 * 3 is 6. But 2 ** 3 is 8.
This is called the exponentiation operation. or 10 ** 4 is 10000 or 10 raised to the power 4 is 10000. Division
15/6 is 2.5. Modulo Division
What is 15%6 ? it is 3 because that is the remainder after
the division. Note that it is not slash but the percentage
symbol. Let’s do one more,
25 % 7 and the answer is 4.
Let’s Review Python is a Programming Language.
Creator is Guido van Rossum. Named after a BBC comedy show.
Hello World Program in Python is print(‘Hello World!’)
Python program file extention is .py Basic Arithmetic Operations we just learned
and Modulo Division If you have any doubts please put those in
the comments below. For more resources please visit : ameerfazal.com. Subscribe to my YouTube
channel for future videos and thanks for watching!