How can I simplify(write correctly) this function in python 3?

```
def calculate_checksum(param):
A = 1
while A < len(param):
for B in range(len(param)-A):
if param[B] < param[B+1]:
param[B], param[B+1] = param[B+1],param[B]
A += 1
```

asked June 10th 19 at 16:21

1 answer

answered on

Solution

Some kind of crap.

```
def calculate_checksum(param):
param.sort(reverse=True)
```

Find more questions by tags Python