Python-Programming

Python-Programming

Photo by Fabian Grohs on Unsplash

Let’s start coding with Python…!

Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python’s design philosophy emphasizes code readability with its notable use of significant whitespace.

Cool Projects that you can do…!

Photo by [Jo Szczepanska](https://cdn.hashnode.com/res/hashnode/image/upload/v1627018448619/PDgFzoZSh.html) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)Photo by Jo Szczepanska on Unsplash

  • Automate yourself

  • Create a calculator

  • Play PyGames

  • Quiz Application

Learning the basics of Python is an amazing experience. We need to remember that Python is another programming language where you can find a lot of complications that will make you feel that you are not a good developer. However, you will need to remember that you need to learn the basics and start building more projects.

What can I do with Python…?

Python for Web Development is an Object-Oriented language, so everybody starting to code will find it easy to play along with Object-Oriented concepts.

Where can I start typing my code..?

As I said previously, the best way to start would be with repl.it. This is a powerful and simple online compiler, IDE, interpreter, and REPL. Code, compile and run in 50+ programming languages.

Let’s Start…!

We will need to start with a smaller project. This projects it’s about creating an Incremental Matrix Calculator.

I understand that you will be confused, but I will recommend you to pay attention to make sure you understand this project. Please take a look at the following steps:

You will need to get an idea of what is an Incremental Matrix Calculator.

Method: The main condition of matrix multiplication is that the number of columns of the 1st matrix must equal to the number of rows of the 2nd one. As a result of multiplication, you will get a new matrix that has the same quantity of rows as the 1st one has and the same quantity of columns as the 2nd one. For example, if you multiply a matrix of ’n’ x ‘k’ by ‘k’ x ‘m’ size you’ll get a new one of ’n’ x ‘m’ dimension. To understand matrix multiplication better input any example and examine the solution.

One thing that I will recommend you is to imagine what you would like to build. Then, the first thing that you will need to do is to create a comment inside of python that allows you to see what you need to build:

Incremental MatrixIncremental Matrix

The second thing that you will need to do is to create a function:

FunctionFunction

The third thing is to indicate to your program what the function needs to do:

Indication of what the function needs to doIndication of what the function needs to do

We need to create a “For” loop that will help us to do the calculation:

Foor LoopFoor Loop

Then, we need to return a value to be able to print the information that we would like to see from our program:

Return and Print ValuesReturn and Print Values

Let’s take a look at the full program:

Your first programYour first program

Let’s take a look at the results:

The results from the Incremental Matrix CalculatorThe results from the Incremental Matrix Calculator

I know what you’re thinking…!

I would like to let you know that this is a lot of information. For this reason, I would like to mention one more time that this journey as a Software Developer. However, if you stay tuned, you will see that everything will make sense.

The Amateur Guide…!

Photo by [Mark Duffel](https://cdn.hashnode.com/res/hashnode/image/upload/v1627018460243/IJkvStg2d.html) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)Photo by Mark Duffel on Unsplash

To start with Python, I will recommend you to install python on your machine. To install Python on windows, you need to download the software here https://www.python.org/downloads/, specifically, we will be using Python 3.7.4 which you can download here. After you start setting up this piece of software, you will need to remember to check “Add Python.exe to path”.

If you are using Mac OS, I will recommend you to Install Brew. Homebrew is a package manager for Mac OS. Please follow the next steps:

  • Launch Terminal: Go to Launchpad > Other > Terminal or Click command + Spacebar > Type Terminal.

  • Install Homebrew: /usr/bin/ruby -e "$(curl -fsSL [https://raw.githubusercont](raw.githubusercont)

  • Install Python3 with Brew: Enter brew command into terminal “brew install python3”

To run python on Windows or Mac OS, you will need to open your terminal and type the following command:

Opening PythonOpening Python

This command will look like this:

Python is working nowPython is working now

To prove that is working, you will need to type “print(“Hello People”)” inside of the account. In other words, you will need to see something like this:

Results from a print statementResults from a print statement

As you can see in the previous image. Then, the most important thing to remember is what is the Data Types that you can use with this Programming Language:

  • Numbers:

Python 3 support 3 different numerical types.

int — for integer values like 90. float — for floating-point values like 5.5. complex — for complex numbers like 3+2 .

  • Strings: Strings in python are contiguous series of characters delimited by single or double-quotes.

Example:

  1. fullname = “Andres Haro”
  • List: List type is another sequence type defined by the list class of python.

Example:

1.- list = [1, 2, 3, 4] or list of names = [andres, adrian, haro]

  • Tuple: In Python, Tuples are very similar to list but once a tuple is created, you cannot add, delete, replace, reorder elements.

Example:

1.- tuple1 = () # creates an empty tuple with no data 2.- tuple2= (11,22,33) 3.- tuple3 = tuple([1,2,3,4,4]) # tuple from array 4.- tuple4 = tuple(“abc”) # tuple from string

  • Dictionary: is a python data type that is used to store key-value pairs. It enables you to quickly retrieve, add, remove, modify, values using a key.

Example:

Home = { ‘Number’ : ‘111–222–333’, ‘Address’ : ‘666–33–111’ }

Control Statements

Control StatementsControl Statements

Examples:

Examples of the Data TypeExamples of the Data Type

Functions: Helps us to organize the structure of the code. We create functions so that we can run a set of statements multiple times during the program without repeating ourselves.

Example 1Example 1

Global Variables: Variables that are not bound to any function, but can be accessed inside as well as outside the function are called global variables.

Global VariableGlobal Variable

Local Variables: Variables which are declared inside a function are called local variables.

Local VariableLocal Variable

Places to learn how to code…!

Photo by Christopher Gower on Unsplash

If you have questions, you will need to email me at . Please take a look at my website, repl, twitter, Github, Spanish Medium Account, and LinkedIn.

Please don’t forget to have a wonderful day and don’t forget to enjoy everything that you do — Coders_forlife.

*Next Guide: Python Functions & Loops*