viligen

largest_number_from_given_digits

Sep 22nd, 2021
862
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. number = input()
  3. list_number = []
  4.  
  5. for digit in number:
  6.     list_number.append(int(digit))
  7. while len(list_number) != 0:
  8.     for i in range(len(list_number)-1, -1, -1):
  9.         if list_number[i] == max(list_number):
  10.             print(list_number[i], end="")
  11.             list_number.pop(i)
  12.             if len(list_number) == 0:
  13.                 break
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
RAW Paste Data