reversed_words = ' '.join(word[::-1] for word in "Hello World".split()) # 'olleH dlroW'
72. Find All Numeric Substrings
python
Copy code
import re numeric_substrings = re.findall(r'\d+', "There are 123 apples and 456 oranges.") # ['123', '456']
73. Capitalize the First Letter of Each Sentence
python
Copy code
text = "hello world. this is python." capitalized_sentences = '. '.join(sentence.capitalize() for sentence in text.split('. ')) # 'Hello world. This is python.'
74. Check if String Contains Only Hexadecimal Characters
python
Copy code
is_hex = lambda s: all(char in "0123456789abcdefABCDEF" for char in s) result = is_hex("1A3F") # True