mirea-projects/First term/Algorithms/4/1.py
2024-09-24 02:22:33 +03:00

22 lines
373 B
Python
Executable File

def main() -> None:
arr = [86, 90, 27, 29, 38, 30, 40]
my_dict = [None] * 7
for num in arr:
key = num % 7
d = 1
while my_dict[key] is not None:
key += d
if key >= len(arr)-1:
d = -1
key -= 1
my_dict[key] = num
print(my_dict)
if __name__ == "__main__":
main()