nerdexam
Python_Institute

PCEP-30-02 · Question #298

order = int(input('Please enter the order value: ')) state = input('Please enter the state (as postal abbreviation): ') delivery = 0 if state in ['NC', 'SC', 'VA']: if order <= 1000: delivery = 70…

The correct answer is A. 120. See the full explanation below for the reasoning.

Question

order = int(input('Please enter the order value: ')) state = input('Please enter the state (as postal abbreviation): ') delivery = 0 if state in ['NC', 'SC', 'VA']: if order <= 1000: delivery = 70 elif 1000 < order < 2000: delivery = 80 else: delivery = 90 else: delivery = 50 if state in ['GA', 'WV', 'FL']: if order > 1000: delivery += 30 if order < 2000 and state in ['WV', 'FL']: delivery += 40 else: delivery += 25 print(delivery)

Options

  • A120
  • B105
  • C80
  • D90

How the community answered

(15 responses)
  • A
    73% (11)
  • B
    7% (1)
  • C
    13% (2)
  • D
    7% (1)

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice