Open pankaj-bind opened 5 months ago
def bead_sort(sequence):
if any(not isinstance(i,int) or i<0 for i in sequence):
raise TypeErro('must be posetive integer')
for _ in range(len(sequence)):
for j,(rod_upper, rod_lower) in enumerate(zip(sequence, sequence[1:])):
print(j,(rod_upper, rod_lower) )
if rod_upper > rod_lower:
sequence[j] -= rod_upper - rod_lower
sequence[j+1] += rod_upper - rod_lower
print(f"aaaa {j} : ",sequence)
return sequence
I think it is too simple ....
please assign me this task