<prompt> Andika suluhisho la tatizo ifuatayo katika Python: Kutokana na mizizi ya mti binary, kurudi wastani wa thamani ya nodes juu ya kila ngazi katika mfumo wa. Majibu ndani ya 10-5 ya jibu halisi itakuwa kukubalika.  <response>: Here is a possible solution in Python:class Solution: def averageOfLevelsself, root: TreeNode - Listfloat: Initialize a queue to perform a level-order traversal queue root Initialize an empty list to store the result result while queue: Compute the average value of the nodes on the current level level_sum 0 level_size lenqueue for i in rangelevel_size: node queue.pop0 level_sum node.val if node.left: queue.appendnode.left if node.right: queue.appendnode.right result.appendlevel_sum level_size return resultIn this solution, we use a queue to perform a level-order traversal of the binary tree. At each level, we compute the sum and size of the nodes on the level, and then compute the average value. Finally, we append the average value to the result list and move on to the next level. The time complexity of this solution is On, where n is the number of nodes in the tree, since we visit each node exactly once. 