mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
converting generator object to a list object (#1602)
* converting generator object to a list object * Refactor: converting generator object to a list object * fixup! Format Python code with psf/black push
This commit is contained in:
parent
4baf3972e1
commit
f4a7c5066c
@ -295,10 +295,10 @@ def main():
|
||||
print("-" * 100)
|
||||
|
||||
# Calculating the value of probabilities for each class
|
||||
# An empty list to store values of probabilities for each class
|
||||
probabilities = (
|
||||
probabilities = [
|
||||
calculate_probabilities(counts[i], sum(counts)) for i in range(n_classes)
|
||||
)
|
||||
]
|
||||
|
||||
# for loop iterates over number of elements in 'probabilities' list and print
|
||||
# out them in separated line
|
||||
for i, probability in enumerate(probabilities, 1):
|
||||
|
Loading…
Reference in New Issue
Block a user