Question: Write a function called two_alpha_categories(word) This function should check which half of the alphabet the first letter of the word parameter belongs to. i.e the
Write a function called two_alpha_categories(word)
This function should check which half of the alphabet the first letter of the word parameter belongs to. i.e the first half of the alphabet is a-m and the second half of the alphbet is n-z
When the first letter of the word is between a-m return 1 (as a integer).
When the first letter of the word is between n-z return 2 (as a interger).
For example:
| Test | Result |
|---|---|
two_alpha_categories("Apple") | |
print (two_alpha_categories("Bear")) | 1 |
print(two_alpha_categories("Elephant")) | 1 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
