Data Science Training in Mumbai :- Using Python in Visual Studio Code.

1

Contents:

What is Python?

What is VSCode and how do we configure it to use Python?

Creating and Running your first Python program in VSCode

What is Python?

Python is a beginner friendly simple programming language that was created between 1985- 1990 by Guido van Rossum.

It may seem very basic and not that sophisticated as other languages but be assured that it has all the capabilities of other new and highly developed programming languages.

Along with having all the features object oriented programming it is also has high-level data structures and is an interpreted scripting language.

The python source code is available under the GNU General Public License (GPL) on its official website.

Today the application of python are vastly diversified from Web development to data science.

Python is easy to lean for beginner and easy to grip for experienced developers in a short duration.

Python is available for development over most of the modern operating systems.

2

What is VSCode and how do we configure it to use Python?

Visual Studio Code is a Source code Editor which is developed by Microsoft for platforms such as Windows, Mac and Linux.

It is an Open Source editor developed by Microsoft with MIT License.

Its look and feel are very similar to Visual Studio IDE made by Microsoft.

It also has support for embedded Git control, debugging, intelligent code completion, snippets, syntax highlighting and code refactoring.

The following describes the language dependent features of VSCode:

3

Now Steps to Configure VSCode for running python code

  1. Install VSCode from the following link for your current Operating System
    4
  2. Visit https://www.python.org/downloads/ and download one of the following versions

    5

    I recommend going with Python 3.6.x version because 3.6.4 is the latest version which will most likely remain stable while 2.7.x is just released to support legacy code.
    While installing python you need to select this option as it is very important and will help us further as we progress
    6

  3. From within Visual Studio Code we need to select a version of Python using the
    Python:
    Select Interpreter command on the Command Palette (Ctrl+Shift+P), or by using the Select Python Environment option on the Status Bar if available at the bottom of the screen:
    7
  4. Open the terminal in VSCode and Navigate to the folder where you have created or want to create a python program
    Python files have an extension of .py

Creating and Running your first Python program in VSCode

First create a new file with .py extension

8

Next let’s write code inside our file and navigate to the folder location where the file exists and then type python [FileName].py

9

#Displays a string
str = input(‘Enter some string’
print(str)

Output:

10





#Takes an input and returns output after checking the condition
m = int(input(‘Enter money’))
if m > 500:
print(m, ‘ is big amount’)
elif m < 100:
print(m,’ is small amount’)
else:
print(m,’is medium’)

Output:

11






Syllabus of Data Science training in Mumbai

Comments

comments

This entry was posted in Class Room Training and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.