I need help trying this Pseudocode to Python please delete_stock(self) Check if a stock is selected. Hint: if (self.stockList.curselection()): get symbol selected by the user in the listbox. Hint: symbol = self.stockList.get(self.stockList.curselection()) set i equal to 0 for each stock in self.stock_list if stock.symbol = symbol call self.stock_list.pop(i) increment i by 1 call self.display_stock_data() delete the entry from the stock list. Hint: self.stockList.delete(0,END) for each stock in self.stock_list if stock.symbol = symbol insert symbol in the stock list. Hint: self.stockList.insert(END,stock.symbol) display a message to the user that the stock was removed. Hint: messagebox.showinfo("Stock Deleted",symbol + " Removed")
I need help trying this Pseudocode to Python please
delete_stock(self)
Check if a stock is selected. Hint: if (self.stockList.curselection()):
get symbol selected by the user in the listbox. Hint: symbol = self.stockList.get(self.stockList.curselection())
set i equal to 0
for each stock in self.stock_list
if stock.symbol = symbol
call self.stock_list.pop(i)
increment i by 1
call self.display_stock_data()
delete the entry from the stock list. Hint: self.stockList.delete(0,END)
for each stock in self.stock_list
if stock.symbol = symbol
insert symbol in the stock list. Hint: self.stockList.insert(END,stock.symbol)
display a message to the user that the stock was removed. Hint: messagebox.showinfo("Stock Deleted",symbol + " Removed")
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images