sibinasto

PF - Basic Syntax - Exercise - 08. Mutate Strings

Jan 16th, 2021
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. first_word = input()
  2. second_word = input()
  3.  
  4. mutate_word = ''
  5.  
  6. for i in range(len(first_word)):
  7.     mutate_word = second_word[:i+1] + first_word[i+1:]
  8.     if mutate_word != first_word:
  9.         first_word = mutate_word
  10.         print(first_word)
Advertisement
Add Comment
Please, Sign In to add comment