Python Basics

Understanding Python

Python is one of the most simple, useful, and powerful programming languages. Python can be used to do anything, including Machine Learning, in a very simplistic manner. Python appears on every sector, finance, aerospace, web/game development, and Machine Learning.

Learn Machine Learning With No Prior Coding Experience

The concept of Machine Learning is very simple, and it can be taught with no coding experience. Don't let coding scare you!

This simple Python tutorial will teach you everything you need to learn in order to start Machine Learning. This includes manipulation of variables and arrays, using libraries and functions.

Variables & Print

In this first example you will learning how print information to a terminal and use variables

1. Try running the loaded program and see what happens! Click “Run” on the top, to go back click “Code”
2. Try typing:

x = 10
print(x)
								
X is what we call a variable, it can store any value, number or word. “Print” is a function that prints anything to the terminal.

Using and Manipulating Arrays

Second, in this example you will be learning how to manipulate arrays. An array is a combined list of variables

1. Try running the loaded program "numbers" is what we call an array, it store a list of variables. You can change individual variables by indexing in the array 2. Try typing, to index the array

print(numbers[0])
								
This prints the first variable of the numbers array. Computers count starting from 0

Python Library & Conditional Statements

Third, in the example you will learn what libraries are, and how to use them. First of all, what is a library? A library allows you to use programs and variables that other people have already made. Instead of making a random number generator yourself from the ground up, you can use a library to get one.

Additionally, you will learn conditional statements. You can use conditional statements to choose a desired outcome.

1. Try running the loaded program. What is the printed result 2. Try changing the x variable, see what happens! 3. Try adding this line just above the conditional statements

x = numpy.pi
									
Add this conditional statement at the very bottom

if x < 4 and x > 3:
    print("This confirms pi is less then 4 and more then 3")
										
Great! Now you are all set for some Machine Learning!