Bài tập String - Nâng cao
Các bài tập về String Methods và Formatting - Nâng cao
def validate_email(email):
# Code của bạn ở đây
pass
# Test
print(validate_email("user@example.com")) # True
print(validate_email("invalid-email")) # False
print(validate_email("user@site.vn")) # Truedef clean_phone_number(phone):
# Loại bỏ tất cả ký tự không phải số, format lại
pass
# Test
print(clean_phone_number("090 123 4567")) # "0901-234-567"
print(clean_phone_number("(090) 123-4567")) # "0901-234-567"def title_case(text):
# Code của bạn ở đây
pass
# Test
print(title_case("the lord of the rings"))
# "The Lord of the Rings"Last updated