Python Tutorial - My First Python Program

Open your command line then type python command or open the python IDLE (Python Integrated Development Environment) and start type your codes.
$ python
Python 2.4.3 (#1, Jan  9 2013, 06:47:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
We always start our first program by printing simple string like "Hello, world" so let us print some strings.

>>> print "Hello, world"
Hello, world
>>> print 'This is my first Python program'
This is my first Python program
We also can print numbers and the result of numerical calculations

>>> print 15
>>> print (15+15)*2
>>> (40-10)/3

If this post was good and helpful for you, Please give it Like.
    Blogger Comment
    Facebook Comment


Post a Comment