MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / Things

Class Things

other/greedy.py:1–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Things:
2 def __init__(self, name, value, weight):
3 self.name = name
4 self.value = value
5 self.weight = weight
6
7 def __repr__(self):
8 return f"{self.__class__.__name__}({self.name}, {self.value}, {self.weight})"
9
10 def get_value(self):
11 return self.value
12
13 def get_name(self):
14 return self.name
15
16 def get_weight(self):
17 return self.weight
18
19 def value_weight(self):
20 return self.value / self.weight
21
22
23def build_menu(name, value, weight):

Callers 1

build_menuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected