# Imports the functionality that we need to display YouTube videos in a Jupyter Notebook.  
# You need to run this cell before you run ANY of the YouTube videos.

from IPython.display import YouTubeVideo 

# WATCH THE VIDEO IN FULL-SCREEN MODE

YouTubeVideo("8_wSb927nH0",width=640,height=360)  # Complex 'if' statements

"""
Explanation: Day 8 - pre-class assignment
Goals for today's pre-class assignment

Use complex if statements and loops to make decisions in a computer program

Assignment instructions
Watch the videos below, read through Sections 4.1, 4.4, and 4.5 of the Python Tutorial, and complete the programming problems assigned below.
This assignment is due by 11:59 p.m. the day before class, and should be uploaded into the "Pre-class assignments" dropbox folder for Day 8.  Submission instructions can be found at the end of the notebook.
End of explanation
"""


# put your code here.




# WATCH THE VIDEO IN FULL-SCREEN MODE

YouTubeVideo("MzZCeHB0CbE",width=640,height=360)  # Complex 'if' statements

"""
Explanation: Question 1:  In the cell below, use numpy's 'arange' method to create an array filled with all of the integers between 1 and 10 (inclusive).  Loop through the array, and use if/elif/else to:

Print out if the number is even or odd.
Print out if the number is divisible by 3.
Print out if the number is divisible by 5.
If the number is not divisible by either 3 or 5, print out "wow, that's disappointing." 

Note 1: You may need more than one if/elif/else statement to do this!
Note 2: If you have a numpy array named my_numpy_array, you don't necessarily have to use the numpy nditer method.  You can loop using the standard python syntax as well.  In other words:
for val in my_numpy_array:
    print(val)
will work just fine.
End of explanation
"""


# put your code here.

my_list = [1,3,17,23,9,-4,2,2,11,4,-7]




"""
Explanation: Question 2:  In the space below, loop through the given array, breaking when you get to the first negative number.  Print out the value you're examining after you check for negative numbers.  Create a variable and set it to zero before the loop, and add each number in the list to it after the check for negative numbers.  What is that variable equal to after the loop?
End of explanation
"""


# put your code here



"""
Explanation: Question 3:  In the space below, loop through the array given above, skipping every even number with the continue statement.  Print out the value you're examining after you check for even numbers.   Create a variable and set it to zero before the loop, and add each number in the list to it after the check for even numbers.  What is that variable equal to after the loop?
End of explanation
"""


# put your code here!



"""
Explanation: Question 4: Copy and paste your code from question #2 above and change it in two ways:

Modify the numbers in the array so the if/break statement is never called.
There is an else clause after the end of the loop (not the end of the if statement!) that prints out "yay, success!" if the loop completes successfully, but not if it breaks.

Verify that if you use the original array, the print statement in the else clause doesn't work!
End of explanation
"""


