avatar Bite 347. Which words can you type with one hand?

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!


Login and get coding
go back Beginner level
Bitecoin 2X

49 out of 51 users completed this Bite.
Will you be Pythonista #50 to crack this Bite?
Resolution time: ~24 min. (avg. submissions of 5-240 min.)

Focus on this Bite hiding sidebars, turn on Focus Mode.