Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. inputString = "1,2,3,4,5"
  2. inputArray = inputString.split(",")
  3.  
  4. print(inputArray)
  5.  
  6. output = ""
  7. for item in inputArray :
  8.   count = int(item)
  9.   while True :
  10.     count += int(item)
  11.     if len(str(count)) > int(item):
  12.       count -= int(item)
  13.       output += str(count) + ","
  14.       break
  15. finalOutput = output[:len(output) - 1]
  16. print(finalOutput)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement