TORONTO KIDS COMPUTER CLUB | PMCA Saturday 18:30 Python Homework 21.05.01.
19372
post-template-default,single,single-post,postid-19372,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Saturday 18:30 Python Homework 21.05.01.

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.
No Comments

Sorry, the comment form is closed at this time.