Skip to main content

Python Tutorials for Beginners - Part 1: Setting Up Your Work Environment and Writing Your First Program

 We will start off by setting up the environment we need to use in order for us to write and run our Python scripts, then we will write a simple program to test that our environment is good to go.

Part 1 - Setting up the Environment:

1 - Download Python: download python from Download Python | Python.org

2 - Download Visual Studio Code

3 - Launch Visual Studio Code --> Click on File --> Preference --> Extensions. 

  • From there search for Python and see if you have the extensions installed. 
    • In the screenshot below, you can see how it looks like when it is already installed. 
  • Install the Python extensions if you don't have them installed already.

Part 2 - Writing our First Program:

Alright... click on File --> New File --> select the Python option as shown in the screenshot below.


We will write a program that says: "What's up, fam!"... just to change things up from the usual Hello World starting programs a lot of tutorials have you doing.

  • We will start off by creating a variable called greeting so we can store the string What's up, fam!
  • From there, we will use the print statement to print out the greeting.

Our code will look something like this:

    greeting = "What's up, fam!"

    print(greeting)


NOTE: Python is sensitive to indentation, so make sure statement are not indented. (You will see later on when you need to indent).

After doing so, click on the Run Python File icon 


At the bottom of Visual Studio Code, you will see the output of your program.

Congratulations! you have just finished writing your first Python program :)

Popular posts from this blog

Logic Gate Truth Tables - Reference Guide (Cheat Sheet)

A logic gate is the implementation of a Boolean function. It performs a logic operation on one or more binary input. By binary I mean that the input can either be 1 or 0, nothing else. This guide is intended to be quick guide\reference, I will dive into more details about each gate on transistor\diode level in other posts. The guide cover gates with 2 inputs, meaning that each truth table will have 4 cases (2^2 = 4) AND Gate: Boolean Logic Operator: Q = A  •  B  Input Output A B Q 0 0 0 0 1 0 1 0 0 1 1 1 Summary: in order to achieve 1 on the output, both inputs A AND B must be 1 OR Gate: Boolean Logic Operator: Q = A  +  B  Input Output A B Q 0 0 0 0 1 1 1 0 1 1 1 1 Summary: in order to ...

LTspice Tutorial: How to Design and Simulate a Circuit in LTspice

 If you do not have LTSpice already installed on your machine, please head over to LTSpice's page on Analog Device's website (Link: LTspice Information Center | Analog Devices ). Note: a video version of this tutorial is available here  Click on the applicable download button that suits your machine's operating system. Upon successfully downloading and launching LTspice, you will be greeted with a window that looks something like in the figure below. Alright, now we will need to create a new schematic. That can be done by either of the following approaches:  click on File then choose New Schematic . click on the New Schematic symbol   on the toolbar. on your keyboard, press Ctrl+N . Upon doing so, a new grey-ish screen will pop up... that will be your new empty schematic (just like the one in the figure below). In this example, we will try to design and simulate a very basic voltage divider.  To recap: a voltage divider is a circuit that takes a certain i...