Pybites Logo

Which words can you type with one hand?

Level: Beginner (score: 2)

In this Bite you will write a function that takes a word and determines if it can be written with only the left or right hand, or if both hands are needed.

We will assume a keyboard with a QWERTY layout and you only have to look at the A-Z chars which we have conveniently mapped to left and right hand chars as per:

(Source: Computer Hope)

So use LEFT_HAND_CHARS and RIGHT_HAND_CHARS in the function. As the return type can only hold three possible values (left, right, both), we created an Enum called Hand which you should use in the return.

Have fun and keep calm and code in Python!