We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Validating Postal Codes
Validating Postal Codes
+ 0 comments ChatGPT and passed all tests:
import re
regex_integer_in_range = r"^[1-9][0-9]{5}$" regex_alternating_repetitive_digit_pair = r"(\d)(?=\d\1)"
P = input()
print(bool(re.match(regex_integer_in_range, P)) and len(re.findall(regex_alternating_repetitive_digit_pair, P)) < 2)
+ 0 comments regex_integer_in_range = r"^[1-9][\d]{5}$" # Do not delete 'r'. regex_alternating_repetitive_digit_pair = r"(\d)(?=\d\1)" # Do not delete 'r'.
+ 1 comment regex_integer_in_range = r"^\d{6}$" regex_alternating_repetitive_digit_pair = r"(\d)(?=.\1)"
+ 0 comments regex_integer_in_range = r"^[0-9]{6}$" regex_alternating_repetitive_digit_pair = r"(.)(?=.\1)"
+ 0 comments You can find some usefull resources to practice your coding skills special related to machine learning form this website:
Load more conversations
Sort 258 Discussions, By:
Please Login in order to post a comment