HackerRank Python - Re.split()




You are given a string s consisting only of digits 0-9, commas ,, and dots .

Your task is to complete the regex_pattern defined below, which will be used to re.split() all of the , and . symbols in s.



  1. regex_pattern = r'[.,]+' # Do not delete 'r'.
  2. import re
  3. print("\n".join(re.split(regex_pattern, input())))




codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube