Advertisement
tod36

08. Mutate Strings

May 21st, 2020
1,293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. first_string = input()
  2. second_string = input()
  3. previous = first_string
  4.  
  5.  
  6. for index in range(0, len(first_string)):
  7.     new_string = ''
  8.     for i in range(0, index + 1):
  9.         new_char = second_string[i]
  10.         new_string += new_char
  11.     for j in range(index+1, len(first_string)):
  12.         new_char2 = first_string[j]
  13.         new_string += new_char2
  14.     if previous != new_string:
  15.         print(new_string)
  16.         previous = new_string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement