SOLUTION to previous video challenge(ANAGRAMS)
def is_anagram_phrase(phrase1, phrase2):
# Remove spaces and convert to lowercase
phrase1_clean = phrase1.replace(" ", "").lower()
phrase2_clean = phrase2.replace(" ", "").lower()
# Check if the sorted characters are the same
return sorted(phrase1_clean) == sorted(phrase2_clean)
# Test the function
print(is_anagram_phrase("William Shakespeare", "I am a weakish speller"))
Welcome to PyQuick! In this quick Python tutorial, we'll learn how to efficiently find the longest common prefix among a list of strings. Our channel is all about providing practical tips, tricks, and logic to help you improve your Python skills in just minutes. However, do note that the videos are not meant for complete beginners who just started Python but for those who have some experience and want to enhance their thinking and skills. If you find this video helpful, be sure to like, share, and subscribe for more bite-sized Python tutorials!
Ещё видео!