mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 16:27:02 +00: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