You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
please assign me this task
The text was updated successfully, but these errors were encountered: