Define a function named translate english_french(french dictionary, word) which takes a translation dictionary and an En
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Define a function named translate english_french(french dictionary, word) which takes a translation dictionary and an En
Define a function named create_words list dictionary(words_list) which takes a list of words as a parameter and creates a dictionary by looping through each element in the list and creating a corresponding key: value item. The function returns a dictiona where the key is a letter and the value is a unique list of words that have the key letter as their last letter, Note: All words in the parameter list are in lowercase. For example: . Test Result words = I'now'.'it', 'is', 'autumn. 'the', 'tortoise','esgs', 'are','fully', 'developed', 'and', 'ready', 'to', 'hatch' d ('de words_dict - create_words_list_dictionary (words) ['th for key in sorted (words_dict) : h["ha print(key, words_dict[key]) n Lau o ['to s['is tit w ['nos y rf
Define a function named create numbers_list_dictionary(numbers list) which takes a list of integers as a parameter and creates a dictionary by looping through each element in the list. The dictionary is to have three keys: 0,1,2 The key of represents numbers from 0-9, the key of 1 represents numbers from 10 - 19 and the key of 2 represents numbers from 20 - 29. The value of each item is a list of numbers which are within the corresponding range. For example: to: 13, 6, 9), 1: [12, 14, 13, 14, 19), 21 (26, 29, 29, 2]> Note: You can assume that numbers are always >= 0 and < 30. For example: Test Result numbers = [1, 23, 3, 22, 25, 6, 12, 9. 24, 28, 2, 27, 13] : [1, 2, 3, 6, 9) a_dict - create_numbers_list_dictionary (numbers) 1: (12, 13] print_dict_in_order(e_dict) 2: (22, 23, 24, 25, 27, 28)