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
>>> 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
>>> 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)
>>> 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.
Good knowlagde on your blog.... Software development
ReplyDeleterogramming apps for android,organic seo services,php web development company,
creative websites,best website design
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
ReplyDeleteIT Software Company
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
ReplyDeleteenticingly 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
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!
ReplyDeleteBusiness 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