var_a = 'This is a string.'
var_b = 21
var_c = ['This','is','a','list','on', 'the',21,'day data challenge.']

"""
Explanation: Welcome to my attempt to summarize the knowledge and skills learned during the 2021 Lighthouse Labs 21 Day Data Challenge. Some examples are pulled directly from their tutorials, and some are my own. 
The daily titles are not the same as the titles used on their website. I have done this to clarify what is being learned in each session.
If you spot any mistakes or feel anything can be clarified, please contact me at pbeens@gmail.com. Thanks! 
Day 1: Variables, f-Strings
Link: https://data-challenge.lighthouselabs.ca/challenge/1
Challenge 1 started with an overview of variables, such as:
End of explanation
"""


x = 'string'
y = 2021

print(f'This is a {x} format and the year is {y}.')

"""
Explanation: Note that strings can be surrounded by single quotes or double quotes, dependent on your style (I like single quotes) or the situation (such as when the string contains a quote).
This was followed by an introduction to f-strings, which I highly recommend everyone learns how to use right away. The example given:
End of explanation
"""


list_of_int = [1,2,3,4,5] #list of integers
list_of_string = ['string1','string2', 'string3'] #list of strings
list_of_anything = [1, 'string', 3.2] #list with an integer, string, and float.

"""
Explanation: Note the 'f' preceding the first quote of the string and that the variables are contained within braces. 
For more information about f-strings, see https://zetcode.com/python/fstring/.
Day 2: Data Types, Lists, sum(), round(), Simple Math
Link: https://data-challenge.lighthouselabs.ca/challenge/2
Numeric Data Types
There are two types of numeric data types: integer (whole number) and float, like fractions or decimals. 
Lists
Lists are a sequence of variables separated by commas and contained within brackets, such as:
End of explanation
"""


lst = ['a', 'town', 'red', 4]
print(lst[0])

"""
Explanation: Note that lists can include multiple data types. Lists can even contain other lists.
Lists are indexed numerically. The first index number is 0 (zero), so the first element of a list would be accessed like this:
End of explanation
"""


lst = [1, 2, 4, 3.245, 99]
print(sum(lst))

"""
Explanation: sum()
The contents of a numeric list can easily be added by using the sum() function:
End of explanation
"""


a = 34.2
b = 21.72

print(a + b) # addition
print(a - b) # subtraction
print(a * b) # multiplication
print(a / b) # division
print(2 ** 3) # exponentiation
print(5 // 2) # integer division
print(5 % 2) # remainder (modulus)

"""
Explanation: Simple Math
Let's do some simple math:
End of explanation
"""


print(a / b)            # no rounding
print(round(a / b, 2))  # 2 decimals places

"""
Explanation: If any of the results above look strange, it's because of the way computers do math. For further reading about this, see:
https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate
Comments
Did you notice the comments in the code above? Anything after a "#" is a comment. Use lots of comments in your code! 
round()
If we want to round any of the results, we can use the round() function:
End of explanation
"""


lst = [1, 2, 4, 3.245, 99]
print(lst[0])

"""
Explanation: Day 3: List Slicing, Dictionaries, and Indexing
Link: https://data-challenge.lighthouselabs.ca/challenge/3
List Slicing
Revisiting lists, sometimes we need to extract more than one item in the list. Recall that lists are indexed starting at 0, as is shown in this previous example:
End of explanation
"""


fruits = ['Apple', 'Pear', 'Orange', 'Banana', 'Kiwi', 'Grapefruit', 'Kumquat']
print(fruits[0:2]) # 'Apple', 'Pear'
print(fruits[1:3]) # 'Pear', 'Orange'
print(fruits[-3:-1]) # 'Pear', 'Orange'

"""
Explanation: Let's now work on extracting more than one item. We'll use a list of fruits and extract different portions. Note that lists can be indexed from the front (index 0) or from the end (index -1). The first index is the start of the slice (inclusive), the second index is the end of the slice, but it does not include that indexed item (exclusive).
End of explanation
"""


print(fruits[:2]) # 'Apple', 'Pear', same as [0:2]
print(fruits[4:]) # 'Kiwi', 'Grapefruit', 'Kumquat'

"""
Explanation: Note that you leave the first part of the argument (the part in the brackets) blank, the slice starts at [0]. If you leave the second part of the argument blank, it ends at the last item:
End of explanation
"""


print(fruits[::-1])

"""
Explanation: What if you want to print the slice backwards? Simple. Just add :-1 to the arguments, as in:
End of explanation
"""


print(fruits[::2])

"""
Explanation: What if you want to print every 2nd item? Check this out:
End of explanation
"""


