PYTHON - BASIC
What is Python ?
- Python is a High Level Programming Language.
Which means you don't have to deal with complex Assembly level instructions. You simply need to write the instructions that are quite similar to English Language and simple Mathematics.
- Python is a language with a Dynamic Type System.
Which means Python is quite easy to read and since it doesn't have a compiler phase it gives a quick turnaround time.
- Python is easy to read.
As said earlier, Python is quite easy to read and write, as code written in Python is quite similar to plain English and Mathematics.
Why should you learn Python ?
- Growing Popularity
A recent analysis done shows that Python has overtaken all the popular languages and is the most popular language now.
- Easy to learn
As said earlier, Python code is quite easy to write due to its simple syntax.
- Minimal lines of Code
The lines of code we write in Python is quite less when compared to other Programming languages.
- Multiple Platfrom Support
Python works seamlessly in Windows, Mac, Linux e.t.c.
First Python Application
Let us write our first Python Application which just prints 'Hello World' on the screen.
Example :
print("Hello World")
Output :
Hello World
And well ! That's all. No semicolon ';', no unwanted lines. You want to print something, only a print(...) statement is more than enough.
And that's the magic of Python. Less lines of code and fun to learn.
Caution : Just remember, Python doesn't allow unwanted white spaces (' ') in front of any statement. This is because it works on 'Indentation'.
The below code throws an error because of a white space in front of the 'print(...)' statement.
Example :
print("Hello World")
Output :
File "add.py", line 1
print("Hello World")
^
IndentationError: unexpected indent