def _list(self, args): """List the supported CVEs. """ table = VeryPrettyTable() table.field_names = ["CVE", "Description", "Versions affected"] for exploit in self.exploits: table.add_row([exploit[0], exploit[1], exploit[2]]) self.logger.handle(table.get_string(), None)
net_total = total_net(netsalarylist) roundednettotal = round(net_total, 2) sal_total = total_sal(salaries) roundedsaltotal = round(sal_total, 2) ret_total = total_ret(retdollarlist) roundedrettotal = round(ret_total, 2) #rounding the lists themselves to two decimal places roundedretdollarlist = [round(x, 2) for x in retdollarlist] roundednetsalarylist = [round(x, 2) for x in netsalarylist] roundedsalarieslist = [round(x, 2) for x in salaries] #defining space as a place holder to make room in the pretty table space = ' ' #adding the information to the pretty table column by column x.add_column("Employee Code", employee_code) x.add_column("Salary($)", roundedsalarieslist) x.add_column("Retirement($)", roundedretdollarlist) x.add_column("Net Salary($)", roundednetsalarylist) #adding a blank row to created space in the pretty table between the values and the totals x.add_row([" ", space, space, space]) #adding the last total row to the pretty table x.add_row(["Total($):", roundednettotal, roundedrettotal, roundedsaltotal]) #printing the pretty table with the title "Title Boxing Franchise" print(x.get_string(title="Title Boxing Franchise")) #printing the employee with the largest salary print("Note! Employee: %s has the largest salary!" % maxemployee)