August 25, 2019

Python Tutorial 1 | Introduction

This is the first of Python Tutorials for Beginners. Let us learn about the Python programming language, how to download and install Python, using the Python interpreter, variables in Python and how to write a program in Python and run it. Please view my Python video tutorial 1 or read on...

Python is an open source programming language. It is easy to use. In many cases, Python needs fewer lines of code than other programming languages to accomplish the same task. Python is understandable because it uses English keywords. Python is an interpreted programming language. This means that there is no need to compile a Python program before running it.

Let us see how to download and install Python. You can get Python 3 from the Python official website. I have shown the steps in the Python Setup in my Python 1 tutorial video.
Next, you should add the path to the Path system variable. This ensures that you can run Python from any drive or any folder on your computer.
You can launch Python from the Python IDLE, which is the interactive Python interpreter. For this, click Start > All Programs > Python 3.x > IDLE. Alternately, you can launch Python from the command prompt. Either way, you should get the Python prompt, which is >>>

Next, you can type Python functions in the Python interpreter. Note that comments begin with # in Python.
>>> help(print) #see the documentation of any Python command
>>> quit()         #quit the Python interpreter

You can create variables in Python to store your data. A variable is a name or reference to your data. Now, Python is a case-sensitive programming language. This means that  v and V are two different variable names. You can continue with Python commands. You can view the Python video tutorial 1 to see such commands in action.
>>> 10 + 20    #this statement computes the expression and displays it 
>>> i = 1         #i is a variable. It is assigned the value 1.
>>> i               #this statement prints the value of i
>>>I                #NameError because variable I is not defined (Python is case-sensitive)
>>>type(i)      #this statement displays the type of data in the variable
>>>i + 5         #this statement computes the expression with the value of i and displays the expression value
>>>del i         #this statement deletes the variable

Next, let us see a small Python program based on the programming logic shown in the following flowchart:


>>> x = 1
>>> y = 2
>>> z = x + y
>>> print(z)

You can type in this Python code directly in the Python interpreter or save it in a Python file (Python scripts have .py file extension). You can see these details in my Python video tutorial 1. Thank you.

4 comments:

  1. Hi, nice information is given in this blog. Thanks for sharing this type of information, it is so useful for me. nice work keep it up

    IT Software Company

    ReplyDelete
  2. Excellent reading! I especially liked the beginning of the article above, which covers everything in great detail. Everything in the article is fascinating and useful. The way you wrote the topic demonstrates how thoroughly you researched it and how much work you put into providing us with detailed information. The way youcategorized the content into sections enables the reader to understand the exact meaning very well. I've never seen a more beautiful article than yours. It's
    enticingly valuable to me.
    Website Development Company in UAE
    Digital Marketing Agency UAE
    Digital Marketing in Muscat
    Digital Marketing Company in Sharjah
    Digital Marketing Company in Riyadh
    SEO Services in Ajman
    Digital Marketing Company in Abu Dhabi
    Digital Marketing Company in Dubai
    Website Development Company in UAE

    ReplyDelete
  3. I love the way you explain everything in detail and sections which helped me to understand the difficult and unheard terms easily. With no doubt your article is one of the best I have read so far. Enjoyed reading the article above , really explains everything in detail, also is very interesting and effective. It is well written. I always search to read the quality content and finally found this post. Keep it up!

    Business Consulting Solutions Hyderabad
    Digital Transformation Services Hyderabad
    DBA Services Hyderabad
    Cloud Consulting Services Hyderabad
    Off Role Staffing Services Hyderabad
    Contract IT Staffing Services Hyderabad
    Payroll Outsourcing Services Hyderabad
    Recruitment Process Outsourcing Hyderabad
    Managing Bench Resources Services Hyderabad

    ReplyDelete

Note: Only a member of this blog may post a comment.