Advertisement
GalinaKG

Zeros to Back

Jun 4th, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. strings = input().split(', ')
  2. new_list = strings
  3.  
  4. for string in strings:
  5.     if string == '0':
  6.         new_list.remove('0')
  7.         new_list.extend('0')
  8.  
  9. print(list(map(int, new_list)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement