CSCI-101: Intro to Computer Science
Python Course

Aaah!

Jon Marius shouted too much at the recent Justin Bieber concert, and now needs to go to the doctor because of his sore throat. The doctor’s instructions are to say “aaah”. Unfortunately, the doctors sometimes need Jon Marius to say “aaah” for a while, which Jon Marius has never been good at. Each doctor requires a certain level of “aah” – some require “aaaaaah”, while others can actually diagnose his throat with just an “h”. (They often diagnose wrongly, but that is beyond the scope of this problem.) Since Jon Marius does not want to go to a doctor and have his time wasted, he wants to compare how long he manages to hold the “aaah” with the doctor’s requirements. (After all, who wants to be all like “aaah” when the doctor wants you to go “aaaaaah”?)

Each day Jon Marius calls up a different doctor and asks them how long his “aaah” has to be. Find out if Jon Marius would waste his time going to the given doctor.

Your Program

Write a program which asks the user for two strings:

  1. The "aaah" Jon Marius is able to say.
  2. The "aaah" the doctor wants to hear.

You may assume that the user will only enter lowercase a's followed by a lowercase h for each input.

Then, your program should determine wether Jon Marius can visit that doctor, and let the user know yes or no.

Lab I/O Format

Your program should use the Lab Input/Output Format, as described below:

  • When prompting for input, use the prompt string WORD>, where WORD is a single, uppercase word which describes the input. For example, this lab you might choose two: JON> and DOCTOR>.
  • When providing output that will be graded, start the line with OUTPUT. Think of this as "boxing your answer" on a math worksheet, it lets us quickly find your answer. We will ignore any lines which do not start with OUTPUT.
  • You may interleave the inputs and outputs in any order you wish. For example, you might want to recieve all of your inputs (order of inputs still matters!), then print all of your outputs (order of outputs still matters!), or you might want to do input/output, input/output, etc. For this lab, this will be unimportant, but know that you will have this freedom later on.

Example Interaction 1

JON> aaaah
DOCTOR> aaaaaaah
OUTPUT no

Example Interaction 2

JON> aah
DOCTOR> aah
OUTPUT yes

Example Interaction 3

JON> aah
DOCTOR> h
OUTPUT yes

License

This problem was derived from a problem by Christian Neverdal Jonassen and is licensed CC BY-SA.