Python Tutorials for Business Analyst – How to Get Started With Python?

Hits: 769

(Python Tutorial – 001)

Python Tutorials for Business Analyst – How to Get Started With Python

 In this tutorial, you will learn to install and run Python on your computer. Once we do that, we will also write our first Python program.

Python is a cross-platform programming language, which means that it can run on multiple platforms like Windows, macOS, Linux, and has even been ported to the Java and .NET virtual machines. It is free and open-source.

Even though most of today’s Linux and Mac have Python pre-installed in it, the version might be out-of-date. So, it is always a good idea to install the most current version.


The Easiest Way to Run Python

The easiest way to run Python is by using Thonny IDE.

The Thonny IDE comes with the latest version of Python bundled in it. So you don’t have to install Python separately.

Follow the following steps to run Python on your computer.

  1. Download Thonny IDE.
  2. Run the installer to install Thonny on your computer.
  3. Go to: File > New. Then save the file with .py extension. For example, hello.pyexample.py, etc.
    You can give any name to the file. However, the file name should end with .py
  4. Write Python code in the file and save it.
    Run Python on your computer
    Running Python using Thonny IDE
  5. Then Go to Run > Run current script or simply click F5 to run it.

Install Python Separately

If you don’t want to use Thonny, here’s how you can install and run Python on your computer.

  1. Download the latest version of Python.
  2. Run the installer file and follow the steps to install Python
    During the install process, check Add Python to environment variables. This will add Python to environment variables, and you can run Python from any part of the computer.Also, you can choose the path where Python is installed.

    Install Python on your computer
    Installing Python on the computer

Once you finish the installation process, you can run Python.


1. Run Python in Immediate mode

Try typing in 1 + 1 and press enter. We get 2 as the output. This prompt can be used as a calculator. To exit this mode, type quit() and press enter.

Run Python in Immediate mode
Running Python on the Command Line

2. Run Python in the Integrated Development Environment (IDE)

We can use any text editing software to write a Python script file.

We just need to save it with the .py extension. But using an IDE can make our life a lot easier. IDE is a piece of software that provides useful features like code hinting, syntax highlighting and checking, file explorers, etc. to the programmer for application development.

By the way, when you install Python, an IDE named IDLE is also installed. You can use it to run Python on your computer. It’s a decent IDE for beginners.

When you open IDLE, an interactive Python Shell is opened.

Python IDLE
Python IDLE

Now you can create a new file and save it with .py extension. For example, hello.py

Write Python code in the file and save it. To run the file, go to Run > Run Module or simply click F5.

Run Python programs in IDLE
Running a Python program in IDLE

Your first Python Program

Now that we have Python up and running, we can write our first Python program.

Let’s create a very simple program called Hello World. A “Hello, World!” is a simple program that outputs Hello, World! on the screen. Since it’s a very simple program, it’s often used to introduce a new programming language to beginners.

Type the following code in any text editor or an IDE and save it as hello_world.py

print("Hello, world!")

Then, run the file. You will get the following output.

Hello, world!

Congratulations! You just wrote your first program in Python.

As you can see, this was a pretty easy task. This is the beauty of Python programming language.

 

Personal Career & Learning Guide for Data Analyst, Data Engineer and Data Scientist

Applied Machine Learning & Data Science Projects and Coding Recipes for Beginners

A list of FREE programming examples together with eTutorials & eBooks @ SETScholars

95% Discount on “Projects & Recipes, tutorials, ebooks”

Projects and Coding Recipes, eTutorials and eBooks: The best All-in-One resources for Data Analyst, Data Scientist, Machine Learning Engineer and Software Developer

Topics included: Classification, Clustering, Regression, Forecasting, Algorithms, Data Structures, Data Analytics & Data Science, Deep Learning, Machine Learning, Programming Languages and Software Tools & Packages.
(Discount is valid for limited time only)

Disclaimer: The information and code presented within this recipe/tutorial is only for educational and coaching purposes for beginners and developers. Anyone can practice and apply the recipe/tutorial presented here, but the reader is taking full responsibility for his/her actions. The author (content curator) of this recipe (code / program) has made every effort to ensure the accuracy of the information was correct at time of publication. The author (content curator) does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause. The information presented here could also be found in public knowledge domains.

Learn by Coding: v-Tutorials on Applied Machine Learning and Data Science for Beginners

Please do not waste your valuable time by watching videos, rather use end-to-end (Python and R) recipes from Professional Data Scientists to practice coding, and land the most demandable jobs in the fields of Predictive analytics & AI (Machine Learning and Data Science).

The objective is to guide the developers & analysts to “Learn how to Code” for Applied AI using end-to-end coding solutions, and unlock the world of opportunities!

 

R tutorials for Business Analyst – Functions in R Programming

Python Exercise: Write a python program to access environment variables

Python Example – Write a Python program to get the users environment