304 North Cardinal St.
Dorchester Center, MA 02124
The re.split() expression splits the string by occurrence of a pattern.
>>> import re >>> re.split(r"-","+91-011-2711-1111") ['+91', '011', '2711', '1111']
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.
It’s guaranteed that every comma and every dot in s is preceeded and followed by a digit.
100 000 000 000
# Enter your code here. Read input from STDIN. Print output to STDOUT import re a = re.split("[,.]",raw_input()) for k in a: if k.isdigit(): print k
import re s = input() for t in re.split(r",|\.", s): if t != '': print(t)
# Enter your code here. Read input from STDIN. Print output to STDOUT import re for item in re.split("[,.]", raw_input()): if item: print item
import re # Enter your code here. Read input from STDIN. Print output to STDOUT s = input().strip() l = re.split(r"[,\.]+",s) for x in l: if x != "": print(x)
In our experience, we suggest you solve this Re.split() Hacker Rank Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
I hope this Re.split() Hacker Rank Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Hacker Rank, Leetcode, Codechef, Codeforce Solution.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
More Hacker Rank Problem & Solutions >>