Last active
September 22, 2017 12:35
-
-
Save volf52/876dc959284578193c5f417fd657bc2c to your computer and use it in GitHub Desktop.
Implementation of upper() function using bit-manipulation - Python
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
def up(inp_str): | |
if ' ' in inp_str: | |
print "No spaces" | |
return | |
else: | |
return ''.join([chr(ord(x) & 95) for x in inp_str]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment