Created
October 28, 2024 04:08
-
-
Save sairam4123/6ae57924700168c1afcaa22a3aaae77a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generates characters | |
class Gen: | |
def __getitem__(self, items): | |
if isinstance(items, slice): | |
start = ord(items.start) | |
end = ord(items.stop) | |
return [chr(char) for char in range(start, end+1)] | |
raise AttributeError("Only slices are allowed.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment