3 + 5 # addition

3 - 5 # subtraction

3 * 5 # multiplication

3/5 # division

3 ** 5 # power

4 // 3 # taking the interger 

5 % 2 # this is a modular operator which takes the remainder. In this case, 5 divided 2 results in 2 and 1 as the remander.

2%4

"""
Explanation: Goal of Week 1
This week, we will:
+ Spend a little bit of time getting farmiliarized with Python the language. What we think are the pros and cons with the language. 
+ Install Python. 
+ Learn some basic operators in Python.
+ Learn about variables and the different types of data in Python (int, float, string, etc.). 
+ Learn about getting user's input using the input() function.
+ Write our first if, else if, and else statements.
Note

In this notebook, I will run the code cell-by-cell to show you the error and the result that Python gives out every time we run a snippet of code. However, you will most likely use a IDE (a.k.a Integrated Development Environment) like the default Python IDE, PyCharm, or something else, which is absolutely fine.

Let's get started!
1. Install Python

If you haven't had Python installed, head to this link and click ‘Download Python 3.5.2’
Install :)

2. Open Python & Create Our Program
To run Python, search your program for IDLE. Open that program.
Now something like this will popup:

That's a Python shell. You can play around with the console like assigning variables, adding numbers, using it as a calculator and it's pretty nice.
However, typically we want to write something nicer so for our purposes, we will write Python scripts or programs. Let's do that.
Choose File -> New File. Now another blank screen will pop up. Let's write our first simple program. Type . . .
python
print("Hello World")
Now go back to the navigation bar and click Run. It will ask if you're OK and ask you to save the file. Name the file whatever you want and let's save.
Basic Math Operators in Python
Now let's start with some basic math operations Python has.
End of explanation
"""


x = 5
m = 3
b = 10
y = m*x + b
print(y)

"""
Explanation: Variables
Alright so that was fun, let's say now I want to calculate y = m*x + b for multiple m, x, and b values. I want to assign numbers to things so you can use and re-use them over again. Turns out it's pretty easy with Python.
End of explanation
"""


print("y =" + y)

"""
Explanation: Printing
Awesome! That's what I wanted. Now let's say I want to be a little bit more explicit with how I print my y. I want to have it explicitly say "y = 25". Let's try to change up how I print that.
End of explanation
"""


print("y =" + str(y))

"""
Explanation: Well that's not good. Python is giving me a TypeError: Can't convert 'int' object to str implicitly. What does that mean? Let's try to google that.
The first result I came accross was this: http://stackoverflow.com/questions/13654168/typeerror-cant-convert-int-object-to-str-implicitly

So it seems like there was a problem with my "y = " being a string and my y being NOT a string. Let's look at the fix the person suggests and see if it works.
End of explanation
"""


print("y = " + str(y))

"""
Explanation: Awesome that works. So it seems the reason was because we tried to add a bunch of words together with a number, which is illegal. Python doesn't quite understand what we wanted to do with it. It's like adding a table and an orange together. It doesn't make sense.
However, notice the statement that was printed out. It wasn't pretty. The number is not spaced properly. So let's go back and add a space between = and the number to prettify that.
End of explanation
"""


type("random things I'm saying")

"""
Explanation: Anyway that problem introduces us to types! Now there a few a types of things in Python.
Data Types
End of explanation
"""


type(5)

"""
Explanation: Python thinks "random things I'm saying" is a string! So anything in quotation means Python will interpret it as a string of characters. It's not a number, it's not a list, it's a series of words.
End of explanation
"""


type(5342.3243)

"""
Explanation: Again, Python 5 is just an integer. Makes sense. Let's see what it thinks of decimal number.
End of explanation
"""


type("5")

"""
Explanation: Wow. It's a float. Why would Python think that? Apparently because there's a lot of more fancy stuff going on under the hood to carry decimals. What would happen if I put 5 in quotation marks. Will Python think it's a string?
End of explanation
"""


user_input = input() # type things in the box below

print("My user_input is " + user_input)

"""
Explanation: Apparently so! Remember everything in quotation marks is considered a string of characters.
So to recap: we have now learned about string, int and float in Python. There's a bunch more data types we will cover in the future but for now let's remember that.
Getting User's Input
A lot of time we want to be interactive and actually get numbers or data from the users using our program. Python has a really neat function called input that will allow us to do that. Let's try it out.
End of explanation
"""


user_input + 432

"""
Explanation: So I don't know what Python did but it takes what I wrote in and printed it out nicely. That's neat. Now let's try to do some calculation with the number I entered.
End of explanation
"""


type(user_input)

"""
Explanation: Again, the TypeError pops up. And again, it's because the types of the things we are adding aren't matching up. Let's do some investigation.
End of explanation
"""


user_input = int(user_input)

type(user_input)

user_input + 432

"""
Explanation: Wow. So even though we input a number, Python thinks that's a string! That's outrageous. So that means if I want to do math operations with that number, I have to convert it to an int or a float so Python know.
End of explanation
"""


my_number = 5

if my_number > 3:
    print("my_number is > 3")
if my_number <= 10:
    print("my_number is <= 10")
if my_number < 0:
    print("my_number is < 0")

"""
Explanation: Now it's legal! Let's now move on to make if statements.
If, Else If, and Else
Almost in any programming language, you can write a boolean statement to see if things are true or false.
End of explanation
"""


if my_number > 3:
    print("my_number is > 3")
elif my_number <= 10:
    print("my_number is <= 10")
elif my_number < 0:
    print("my_number is < 0")
else:
    print("I don't know who I am!")

"""
Explanation: So that works as we expected. Python runs through the 3 conditions, check if my_number satisty each one, and does the work. Now let's see what happens when we use an if, elif, and else instead.
End of explanation
"""


