Write a script to define 2 commands 'stock' and 'greet' for the shell cmd2 imported from Cmd module.
1.Stock <nasdaqsymb> will return the current sharevalue of the symbol entered.
2.Greet, will return "Hi!, <username>"
Solution
From 'Greet' command I have used getuser()
From 'Stock <nasdaqsymb> I have used requests.get()
Code
::
from cmd2 import Cmd
from getpass import getuser
import sys
import requests