Question: Write a function that generates postcards as strings only for prices strictly lower than 100 . The output must be a dictionary with names as

Write a function that generates postcards as strings only for prices strictly lower than 100. The output must be a dictionary with names as keys and postcards as their corresponding values. Postcards have the following components, all in lowercase:

The first four letters of the persons first name, if not enough, take all

The age

The persons full last name

The last digit of the price

The place

Write a function that generates postcards as strings only for prices strictly

1. You can assume that there won't be any duplicate names in the inputs as it could cause issues with duplicate keys in the output dictionary. 2. You can create a dictionary using dict( ) without a loop if you have a list of length-2 tuples, one for key and another for value. 3. The zip() function might be useful when creating the list of tuples above. 4. You may want to implement the function using for/while loops and/or list comprehension for extra practice def personalized_postcards(team): "I" > personalized_postcards ([ ... ('Yue Wang', 96, 18, 'Hoover Dam'), ... ('Cleo Patra', 10, 32, 'Bellagios') (..] ]) \{'Yue Wang': 'yue18wang6hoover dam', 'Cleo Patra': 'cleo32patraobellagios' } > personalized_postcards ([]) \{\} > personalized_postcards ([ ... ('Mari Noh', 155, 18, 'tram'), ... ('Gwen Am', 34, 54, 'Venetian'), ... ('Freya Dog', 34, 1, 'The Strip') (..] \{'Gwen Am': 'gwen54am4venetian', 'Freya Dog': 'freyldog4the strip'\} "II

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!