Re5 1224. Regex count lowercase letters Your task is simply to count the total number of lowercase letters in a string. Examples lowercaseCount("abc"); ===> 3 lowercaseCount("abcABC123"); ===> 3 lowercaseCount("abcABC123!@€£#$%^&*()_-+=}{[]|\':;?/>. 2022. 12. 25. 1223. validate code with simple regex Basic regex tasks. Write a function that takes in a numeric code of any length. The function should check if the code begins with 1, 2, or 3 and return true if so. Return false otherwise. You can assume the input will always be a number. Solution: def validate_code(code: int) -> bool: return int(str(code)[0]) 2022. 12. 23. 1208. A Strange Trip to the Market You're on your way to the market when you hear beautiful music coming from a nearby street performer. The notes come together like you wouln't believe as the musician puts together patterns of tunes. As you wonder what kind of algorithm you could use to shift octaves by 8 pitches or something silly like that, it dawns on you that you have been watching the musician for some 10 odd minutes. You a.. 2022. 12. 8. Remove anchor from URL Complete the function/method so that it returns the url with anything after the anchor (#) removed. Examples "www.codewars.com#about" --> "www.codewars.com" "www.codewars.com?page=1" -->"www.codewars.com?page=1" Solution: def remove_url_anchor(url): i = url.find("#") return [url, url[:i]][i!=-1] Order Solution: def remove_url_anchor(url): return url.split('#')[0] def remove_url_anchor(url): retu.. 2022. 8. 9. Jaden Casing Strings Description: Jaden Smith, the son of Will Smith, is the star of films such as The Karate Kid (2010) and After Earth (2013). Jaden is also known for some of his philosophy that he delivers via Twitter. When writing on Twitter, he is known for almost always capitalizing every word. For simplicity, you'll have to capitalize each word, check out how contractions are expected to be in the example bel.. 2022. 4. 1. 이전 1 다음