This is an optional exercise to test your understanding of Python Basics. The questions tend to have a financial theme to them, but don't look to deeply into these tasks themselves, many of them don't hold any significance and are meaningless. If you find this extremely challenging, then you probably are not ready for the rest of this course yet and don't have enough programming experience to continue. I would suggest you take another course more geared towards complete beginners, such as Complete Python Bootcamp
In [3]:
price = 300
In [4]:
Out[4]:
In [6]:
Out[6]:
In [1]:
stock_index = "SP500"
In [2]:
Out[2]:
In [7]:
stock_index = "SP500"
price = 300
In [9]:
Given the variable of a nested dictionary with nested lists:
stock_info = {'sp500':{'today':300,'yesterday': 250}, 'info':['Time',[24,7,365]]}
Use indexing and key calls to grab the following items:
In [10]:
stock_info = {'sp500':{'today':300,'yesterday': 250}, 'info':['Time',[24,7,365]]}
In [12]:
Out[12]:
In [15]:
Out[15]:
In [16]:
In [18]:
source_finder("PRICE:345.324:SOURCE--QUANDL")
Out[18]:
In [19]:
In [20]:
price_finder("What is the price?")
Out[20]:
In [22]:
price_finder("DUDE, WHAT IS PRICE!!!")
Out[22]:
In [23]:
price_finder("The price is 300")
Out[23]:
In [46]:
In [44]:
s = 'Wow that is a nice price, very nice Price! I said price 3 times.'
In [47]:
count_price(s)
Out[47]:
In [27]:
In [30]:
avg_price([3,4,5])
Out[30]: