Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Clean and simple. solution in Clear category for Best Stock by Celshade
def best_stock(data):
"""Return best stock price.
Args:
data (dict): a dictionary of stock prices.
Returns:
str: the stock with the best price.
"""
val = max(set(data.values()))
for item in data:
if data.get(item) == val:
return item
June 9, 2018