Learning A New Language: Python Part 1

The acquisition of Python appears to be a “no-brainer” in terms of desired skills in the marketplace today. Python is exciting as it can be leveraged for a multitude of purposes: web development, data science, and machine learning. Python is a high-level programming language that is designed to be readable and efficient in terms of lines of code used. Its core, user-friendly approach reminds me a lot of Ruby — a language that I already know and love!

Source: https://stackify.com/wp-content/uploads/2019/01/Ruby-vs-Python-1280x720.jpg

1. Variables

2. Conditional Statements

We can incorporate the else keyword to capture what happens if the statement evaluates to false.

The elif keyword can be used to check for more cases as well.

3. Iteration (Looping)

The for loop dictates that for x, execute the code block.

4. Lists

To get a specific value from a list, we can leverage the element’s index. The index starts with 0.

There are methods to manipulate lists; some of which include:

5. Dictionary: Key-Value Pairs

6. Classes & Objects

Here sidney is an object (or instance) of the Dog class. In order to set attributes of sidney, we will define our class to receive data when an object is initiated.

You can reassign the values of attributes as such:

7. Non-Public Instance Variables

8. Class Inheritance

Software Engineer with RIA in a Box.