b = 5
b = 6

assert b == 6

"""
Explanation: 3: Interface
Instructions
The code below assigns the value 5 to the variable b. Add a new line below that assigns 6 to b.
End of explanation
"""


# Here's a comment!
b = 5
# Here's another comment! Neither of these comments are evaluated by Python!
# this is my comment

"""
Explanation: 4: Comments
Instructions
Make your mark in the code by adding a comment.
End of explanation
"""


b = 6
print(b)
print(500)

"""
Explanation: 5: Print function
Instructions
Use the print() function to display the value stored in b. Then, use the print() function to display the number 500.
End of explanation
"""


# Integer
i = 1
# String
s = "Hello World"
# Float
f = 55.55

hundred_integer = 100
hundred_string = "hundred"
hundred_float = 100.5

assert hundred_integer == 100

"""
Explanation: 6: Types
Instructions
Assign the integer value 100 to the variable named hundred_integer. Assign the string value "hundred" to the variable named hundred_string. Assign the float value 100.5 to the variable named hundred_float.
End of explanation
"""


a = type(5)
# The type is assigned to a. When you print the type, it is abbreviated to `str`
print(a)

c = type(10)
print(c)

"""
Explanation: 7: Type function
Instructions
Assign the type of 10 to c then use the print() function to display c.
End of explanation
"""


five = 5
twenty_five = five * 5
negative_five = -five
assert twenty_five == 25
assert negative_five == -5

"""
Explanation: 8: Arithmetic operators
Instructions
The variable five contains the integer value 5.
Use the arithmetic operators and the variable five to perform calculations that result in 25. Assign to the variable twenty_five.
Use the arithmetic operators and the variable five to perform calculations that result in -5. Assign to the variable negative_five.
End of explanation
"""


ten = "10"
eight = 8

int_ten = int(ten)
str_eight = str(eight)

assert int_ten == 10
assert str_eight == u"8"

"""
Explanation: 9: Converting types
Instructions
The variable eight contains the integer 8 and the variable ten contains the string "10". Convert eight to a string using the str() function and assign to str_eight. Then convert ten to an integer using the int() function and assign to int_ten.
End of explanation
"""


l = []

# Print the type of `l` to confirm it's a list.
print(type(l))
l.append("January")
l.append("February")
l.append("March")
l.append("April")
print(l)

"""
Explanation: 11: Lists
Instructions
Add new code that appends March to the list l, then appends April to the list, then displays that list, l, using the print() function.
End of explanation
"""


l = ["January", "February", "March", "April"]
m = [0,1,2,3]
years = [_ for _ in range(2010, 2015)]
print(years)

"""
Explanation: 12: Creating lists with values
Instructions
Write a single line of code that creates a list years and fills it with the integer values 2010, 2011, 2012, 2013, and 2014, in that order.
End of explanation
"""


o = [u"Jan", 5., 1., u"uary", 10]

print(o)

"""
Explanation: 13: Multiple types in list
Instructions
Create a list o that contains the following elements, in order:
* "Jan" (string)
* 5.0 (float)
* 1.0 (float)
* "uary" (string)
* 10 (integer)
End of explanation
"""


int_months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
index_four = int_months[4]
last_value = int_months[-1]

"""
Explanation: 14: List index
Instructions
The list int_months contains the values 1 to 12. Select the value at index 4 and assign to the variable index_four. Then select the last value in the list and assign to last_value.
End of explanation
"""


months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov"]
second_last = months[-2]

"""
Explanation: 15: List length
Instructions
Retrieve the second to last element from the list months and assign it to second_last. Then use the print() function to display second_last.
End of explanation
"""


months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"]
eight_eleven = months[8:12]
ending_index = len(months)
eight_eleven = months[8:ending_index]

five_nine = months[5:10]
print(months[:5])

"""
Explanation: 16: List slicing
Instructions
Use slicing to return a list named five_nine that contains the values from index 5 to index 9 (including the value at index 9). Then use the print() function to display the first 5 elements in months.
Answer
End of explanation
"""


