Hi Guys, we are going to discuss the Python Environment Setup. In the previous article, we had discussed the introduction of Python and started the Python tutorials.
What will be covered in this article:
What’s inside: Python Environment Setup Installing on Windows What is a keyword in Python? Execute Python first code Indentation in Python Comment in Python How to take user input in Python |
Let’s start Now….
Python Environment Setup:
If you do not have installed Python on your computer, then you can download the latest version for free from Python’s official website:
After downloading the application, we have to set the path on your computer.
This is all traditional way, and I have work on Python’s CMD, JUPITER, Spyder, PyCharm. I feel more comfortable with JUPITER So, I am going to start ‘How to install JUPITER ‘. For JUPITER we have to download ANACONDA for downloading ANACONDA click here.
The given link takes you to the application’s official site from where you can download it.
Click on the download button, which is giving in the above image. It directs you to the downloading options like-
You can select the suitable version for your operating system. After a successful download, we have to choose the location where you want to add the Anaconda to your PATH environment variable.
Installing on Windows
Here, We recommend not adding Anaconda to the environment variable, since this can interfere with other software. Instead of this, you can use the software by opening Anaconda Navigator or the Anaconda Prompt from the Start Menu.
Here, you go. You have successfully installed the Anaconda in your system (Laptop/ Desktop).
You can search in your start options and see the application in your system.
You can see that the home page where you can find the Jupyter Notebook. Instead of Jupyter notebook, you can also go with Spyder.
Python Syntax:
What is a keyword in Python?
Like other languages, a programming language embraces certain predefined words that are known as keywords. A predefined rule of uses for each keyword is called Syntax.
In Python, there is a total of 33 keywords present. These 33 have a predefined meaning attached; they cannot be modified or used for any other purpose in the program. You can get these keywords by using the help () commands.
Except for the first three keywords (False, None and True), the other keywords are in lowercase.
Execute Python first code:
As we learn from previous python introduction: Python syntax is executed by writing directly in the Command Line that is shown in the below example:
Indentation in Python
Indentation in Python defines the spaces at the beginning of a code line. Python is different from other languages; it provides no braces to indicate a code block for class and function, etc.
Python uses consistent indentation to denote a block of statements. When a block is to be started, we have to type the colon (:) and press Enter.
Blocks of code are indicated by line indentation in Python. It is very important to give the same amount of indent space within the block. For example:
if x=y:
print "True"
else:
print "False"
Comment in Python
In Python # is used for the commenting any statement. If # is the first character of the any line, then the whole line will be a comment.
# this is my comment
.
print ("Hello")
How to take User input?
By using the input() function, we can take user input in Python. It is part of the core library of Python’s standard library. For Instance:
print("Enter your name:")
name = input()
print("Hello, " + name)
In the above, We have covered the Python Environment Setup step by step after that, we have also discussed the Python Syntax with Suitable examples. In the coming one, we will be going to discuss the variable and DATA Types in Python. So, stay with us, and for any query, please comment or mail us.
Thank You 🙂