Hello guys.
This article is the fourth of this series. In this am providing the basics of Python scripts by comparing them with several other object oriented languages to present a clear view of Python and other languages.
For getting the theme of Python, kindly go through my previous articles,
Getting the Theme
Basics of Python
- Writing Basic Python Snippet
- Python | Identifiers
- Python | Keywords
- Python | Comments
- Summary
Writing your First Script
- #include<iostream.h>
- Int main()
- {
- cout << “GoodBye World!”;
- }
Output
GoodBye World
- public class Main
- {
- public static void main(String[] args)
- {
- System.out.println("GoodBye World!");
- }
- }
Output
GoodBye World
- using System;
- public class Hello2
- {
- public static void Main()
- {
- Console.WriteLine("GoodBye World!");
- }
- }
Output
GoodBye World
- Print “GoodBye World!”
Output
GoodBye World
Pin Point
- Must start with upper case (A … Z) or lowercase (a … z) letters
- It can be also start with an underscore "_" , followed by more letters
- It can also be the combination of underscore and numbers
Pin Points
- Since Python is a case sensitive programming language, "Abhishek" and "abhishek" are different things for it.
- Python doen't allow you to use some special characters (@, #, $, %) in your identifier name.
- Class names start with a uppercase letter followed by the lowercase.
Python | Keywords
A keyword, in general programming terms can be defined as,
"These are reseved words that are already used in language for defining some special taks or functionalities and you can't use them as a constant or variable name in your code.
Let's quickly have a look at those.
| And | Assert | Break |
| class | Continue | def |
| del | elif | else |
| except | exec | finally |
| for | from | hglobal |
| if | import | in |
| is | lambda | Not |
| or | pass | |
| raise | return | try |
| while | with | yeild |
Python | Comments
I love C# and more than that the symbol "#", so guys if you are .Net developer and you also love that symbol, then trust me you won't miss that in Python because in Python a line that starts with a hash "#" is considered to be a comment by the Python interpreter.
So write comments and enjoy Python, write as much as you can but in a limit and trust me it will help you too. How? It will make your code more understandable, readable and it also considered as one of the guidelines of programming. So cheers.
Have a look at the following snippet.
# So let's Print Something- Comment 1
Print “A chunk of text!” # Print- Comment2
No worries, if you want a multiline comment in Python. You can easily do that using this structure:
“””
Your comments go here…
“””
For Example
“””
This is my multiline comment in Python...
“””
Print “A chunk of text!”
This fourth part was for making you comfortable with Python. That is why I made several comparisons above.
Single-Line Comments
Multiline Comments
Summary

Guidelines from my Side
- Do as much as code you can.
- Code anything you want, the best way to learn
- Don't just study things, try to learn them.
- Work on your concepts
- Work on the fundamentals of any technology or stuff you want to learn.
Moto
“Keep calm and code Python”.
I tried to make this an interesting and interactive article and I wish you guys do like that, meanwhile, if you have any suggestions then you are welcome.
Until the next part, keep sharing.

Sandeep KumarPosted Sep 28, 2015, 1:03 AM
Nice sir :)
vanama saishanthanPosted May 13, 2015, 8:17 AM
Nice article i have a small doubt, there are any frameworks for python.
Gopi ChandPosted May 12, 2015, 2:50 PM
Again its a good one for me..thanks..
Sanyam KhuranaPosted May 12, 2015, 2:45 PM
Adding to this, Python would be mostly used for creating automating scripts in your day to day life :)
Abhishek JaiswalPosted May 12, 2015, 2:59 AM
Thank you! :)
Santhakumar MunuswamyPosted May 12, 2015, 12:26 AM
Thanks for nice article..