Advertisement
UniQuet0p1

Untitled

Jan 7th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def mix_string(s1: str, s2: str) -> str:
  2. """
  3. Given two strings s1 and s2, create a mixed string by alternating between str1 and str2 chars.
  4.  
  5. #2
  6.  
  7. mix_string("AAA", "bbb") -> AbAbAb
  8. mix_string("AA", "") -> AA
  9. mix_string("mxdsrn", "ie tig") -> mixed string
  10. """
  11.  
  12.  
  13. if __name__ == '__main__':
  14. print(mix_string("AAA", "bbb")) # "AbAbAb"
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement