Python_Institute
PCEP-30-02 · Question #392
Drag and drop the code boxes in order to build a program which prints Unavailable to the screen. (Note: one code box will not be used.)
prices = { "pizza": 3.99 } try: charge = prices["calzone"] print("Charged") except KeyError: print("Unavailable") except: pass print("Out of bounds")
Module 3: Boolean Values, Conditional Execution, Loops, Lists and List Processing, Logical and Bitwise Operations
Question
Drag and drop the code boxes in order to build a program which prints Unavailable to the screen. (Note: one code box will not be used.)
Explanation
prices = { "pizza": 3.99 } try: charge = prices["calzone"] print("Charged") except KeyError: print("Unavailable") except: pass print("Out of bounds")
Topics
#conditional logic#boolean values#program construction#output
Community Discussion
No community discussion yet for this question.