我需要一个函数,要求用户提供股票符号和名称配对,然后将其添加到名称字典。但到目前为止我只知道
def addname(x,y):
dicname = {(x): (y)}
return dicname;
stocksymbol = (input("what is the symbol of your stock"))
stockname = (input("what is the name of your stock"))
addname(stocksymbol, stockname)
dnames = {dicname}
谢谢任何想帮忙的人
这就是你要找的吗?很难从你的问题中知道:
印刷品:
这应该起作用:
输出
相关问题 更多 >
编程相关推荐