SimeonTs

SUPyF2 Basic Exercise - 08. Mutate Strings

Sep 24th, 2019
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1. """
  2. Basic Syntax, Conditional Statements and Loops - Exercise
  3. Check your code: https://judge.softuni.bg/Contests/Compete/Index/1719#7
  4. Video: https://www.youtube.com/watch?time_continue=4&v=7sHE4HEUqi8
  5.  
  6. SUPyF2 Basic Exercise - 08. Mutate Strings (not included in final score)
  7.  
  8. Problem:
  9. You will be given two strings. Transform the first string into the second one, one letter at a time and print it.
  10. Print only the unique strings
  11. Note: the strings will have the same lengths
  12.  
  13. Examples:
  14. Input:
  15. bubble gum
  16. turtle hum
  17. Output:
  18. tubble gum
  19. turble gum
  20. turtle gum
  21. turtle hum
  22. turtle ham
  23. Input:
  24. Kitty
  25. Doggy
  26. Output:
  27. Ditty
  28. Dotty
  29. Dogty
  30. Doggy
  31. """
  32.  
  33. string_1 = [letter for letter in input()]
  34. string_2 = [letter for letter in input()]
  35.  
  36. for letter in range(len(string_2)):
  37.     if string_1[letter] != string_2[letter]:
  38.         string_1[letter] = string_2[letter]
  39.         print("".join(string_1))
Add Comment
Please, Sign In to add comment