Skip to content

Instantly share code, notes, and snippets.

@volf52
Last active September 22, 2017 12:35
Show Gist options
  • Save volf52/876dc959284578193c5f417fd657bc2c to your computer and use it in GitHub Desktop.
Save volf52/876dc959284578193c5f417fd657bc2c to your computer and use it in GitHub Desktop.
Implementation of upper() function using bit-manipulation - Python
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