Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = 'Nasty_Ney' + ' N_N ' + ' XP '
- from collections import deque
- from string import ascii_letters
- nth_letter = 1
- alpha = ascii_letters[26: 53]
- alpha_deque = deque(alpha, maxlen=26)
- while nth_letter < 27:
- first, second, third, all_others = 'st', 'nd', 'rd', 'th'
- current_letter = alpha_deque.popleft()
- # conditional logic
- if nth_letter == 1 or nth_letter == 21:
- print( '{0} is the {1}'.format(current_letter, nth_letter) + first + ' letter of the alphabet.' )
- elif nth_letter == 2 or nth_letter == 22:
- print( '{0} is the {1}'.format(current_letter, nth_letter) + second + ' letter of the alphabet.' )
- elif nth_letter == 3 or nth_letter == 23:
- print( '{0} is the {1}'.format(current_letter, nth_letter) + third + ' letter of the alphabet.' )
- else:
- print( '{0} is the {1}'.format(current_letter, nth_letter) + all_others + ' letter of the alphabet.' )
- nth_letter += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement