Devtantra Blog

Tutorials about Android, Angular, ReactJS, PHP, MySQL and Web Development

Python for Beginners

Python is a very powerful and simple languages. Python is an interpreted programming language, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development. Basically python run interpreter from script. Python syntax are very easy, you can easily remember them. Its a languages which not want any ending tag or any notation like other languages. If you are the beginner in programming and you know C,C++ basic concepts then you can easily understand this languages because it is a very easy language.

Python for beginners

Below i am showing you how to work in python by the help very easy examples . Before going to example side first install python in your desktop/laptop.

Installation

For window :

Visit https://www.python.org/downloads/ and download the latest version.

  1. Right click on Computer from your desktop and select Properties or click
    Start and choose Control Panel → System and Security → System .
    Click on Advanced system settings on the left and then click on the
    Advanced tab. At the bottom click on Environment Variables and under
    System variables , look for the PATH variable, select and then press Edit .
  2. Go to the end of the line under Variable value and append ;C:\Python27 (please
    verify that this folder exists, it will be different for newer versions of Python) to the
    end of what is already there. Of course, use the appropriate folder name.
  3. If the value was %SystemRoot%\system32; It will now become %SystemRoot
    %\system32;C:\Python27
  4. Click OK and you are done.

For Linux/Unix :

Python must be installed already. To verify, open the terminal by opening the Terminal application or by pressing Ctrl+Alt+T and entering gnome-terminal . If that doesn’t work, please refer the documentation of your particular GNU/Linux distribution. Now, run python and ensure there are no errors.
You can see the version of Python on the screen by running:

developer@yours:~$ python -V
Python 2.7.3

First Python Example

Open the terminal in your operating system and then open the Python prompt by typing python and pressing enter key.
Once you have started Python, you should see >>> it means your python interpreter is ready .

At the Python interpreter prompt, type:

print "Hello world"

Note: Not use any semicolon at end of any command or syntax 

Math programs

>>>1 + 1
2
>>> 20+80
100
>>> 10000+99
10099
>>> 6-5
1
>>> 2*5
10
>>> 5**2
25

Conclusion

As you seen that python has not required any semicolon etc. because it is working on white-space system, Which help us very much so for that reason python is very easy languages. Best of luck 🙂

0
0

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: