05 May PMCA Saturday 18:30 Python Homework 21.05.01.
Question 1:
Given two strings, check if two strings are anagrams of each other
An anagram is a word, phrase, or name formed by rearranging the letters of another, such as cinema, formed from iceman.
Print True, if two strings are anagrams of each other otherwise print False.
Sample Execution 1 Input String one: abode String two: adobe Output True Explanation: abode and adobe have the same characters, which is why they are anagrams of each other Sample Execution 2 Input String one: apple String two: aple Output False Explanation: Both apple and aple are not anagrams of each other. Even though they have the same character, the quantity is different. Hint >>> d1 = {'a':1, 'b':2} >>> d2 = {'b':2, 'a':1} >>> d1 == d2 True To check if two dictionaries are the same, you can use the == operator in python.
Sorry, the comment form is closed at this time.