View the step-by-step solution to:

Question

Submit the python code for the following problem :


Show all apple variety

names

Get the variety that user wants to know more about.

List out the characteristics of that variety.

Sample input : 

granny smith 

-

this should print 3 characteristics (tart, crunchy & freezes well).

jona

gold 

-

this should print that it does not have much info on 

jona

gold.


produce = { 'apple': { 9100:{'price':1.30,'type':'gala'},

                        9101:{'price':1.40,'type':'red delicious'},

                        9102:{'price':1.50,'type':'granny smith'},

                        9103:{'price':1.60,'type':'fuji'},

                        9104:{'price':1.40,'type':'red delicious'},

                        9105:{'price':1.50,'type':'granny smith'},

                        9106:{'price':1.60,'type':'fuji'},

                    },

            'orange' :{ 9200:{'price':1.50, 'type':'navel'},

                        9201:{'price':1.90, 'type':'tangerines'},

                        9202:{'price':1.80, 'type':'mandarin'}

                    },

           'pear' : { 9300:{'price':1.30, 'type':'anjou'},

                       9301:{'price':1.40, 'type':'bartlett'},

                       9302:{'price':1.80, 'type':'bosc'}

                    }

             }


specs = {'apple' : {'varieties':['red delicious', 'gala', 'fuji', 'honeycrisp', 'cripps pink',

                                 'granny smith', 'jona gold', 'lady alice'],

                    'sweet':['red delicious', 'gala', 'fuji', 'honeycrisp', 'cripps pink'],

                    'tart' : ['granny smith','cripps pink', 'lady alice'],

                    'crunchy':['red delicious','fuji','granny smith'],

                    'freezes well':['fuji', 'granny smith', 'honey crisp','cripps pink' ]

                   }

        }

Top Answer

View the full answer
applesOutput.png

> python apples . py
Varieties of apple :
red delicious
gala
fuji
honeycrisp
cripps pink
granny smith
jona gold
lady alice
Enter a variety : granny smith
Characteristics of granny smith :...

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question