How to determine the composition of character elements by python
Xiaobian to share with you how python to achieve character element composition determination, I hope you have something to gain after reading this article, let's discuss it together!
Character element composition determination
Check whether the elements of two strings are the same.
from collections import Counter def anagram(first, second): return Counter(first) == Counter(second) anagram("abcd3", "3acdb") # Truepython What are the data types? Python data types: 1. Number types, including int, long, and float. 2. Strings of type str and unicode. 3. Python Boolean types are also used for logical operations and have two values: True and False. Lists are the most frequently used data types in Python, and collections can be any data type. 5. Tuples, tuples are identified by "()" and inner elements are separated by commas. 6. A dictionary is a collection of key-value pairs. 7. A set is an unordered, non-repeating combination of data.
After reading this article, I believe you have a certain understanding of "how python realizes character element composition determination". If you want to know more about it, welcome to pay attention to the industry information channel. Thank you for reading!