Mar-28-2019, 10:58 PM
Hello!
I want to write a function ,def count_words_starting_with_given_letter(text, letter):, for example:
print(count_words_starting_with_given_letter('Tom has tiger ', 't') == {'Tom': 1, 'tiger': 1}).
I know how to write code, but I have to use dictionary comprehension and I am little confused.
I want to write a function ,def count_words_starting_with_given_letter(text, letter):, for example:
print(count_words_starting_with_given_letter('Tom has tiger ', 't') == {'Tom': 1, 'tiger': 1}).
I know how to write code, but I have to use dictionary comprehension and I am little confused.