19

What would you do differently from this? PEP 8: Variable names should be lowercase. People -> people. As @FMc suggested in the comment, better to separate computation and printing. It is easier to understand and change. An alternative (that I find more readable) is to use a lambda in the max function and unpack the tuple afterward: people = {'Harry': ...


5

I don't know what your value represents, so I will assume age. Since you already have an implementation ready, which is good enough. I think just wrapping the code in a function would increase the readability of your code. This way you're providing a descriptive API for the functionality. You can then reuse this in multiple places and change the ...


1

Path The use of Path is a bit pointless. There is no need to use an absolute path to access the file. Converting the Path to a String seems wrong. Conversion to a File with the method .toFile() would make more sense. IF you convert to a String, then the method .toString() may be more conventional than using String.valueOf(). You pass the path to the Player ...


1

Despite the code produce the desired output in your simple test case, your implementation is quite flawed. a = hash_table(size) insert_hash(a, 1, 'john') insert_hash(a, 2, 'edward') delete_hash(a, 1) print_hash(a, 2) Output: Traceback (most recent call last): File "C:/Code Review/hash_table.py", line 53, in <module> print_hash(a, 2) ...


Only top voted, non community-wiki answers of a minimum length are eligible