Created
August 17, 2014 11:12
-
-
Save typedt/c7255ea51608fe52b85c to your computer and use it in GitHub Desktop.
Solution to Problem 1 of PythonChallenge.com
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
#!/usr/bin/env python | |
s = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj." | |
def make_rotation(i): | |
def rotate(x): | |
if x.isalpha(): | |
shift = i if ord(x) + i < 123 else i - 26 | |
return chr(ord(x) + shift) | |
else: | |
return x | |
return rotate | |
for i in range(0,26): | |
print '\nindex:%d' %i | |
print ''.join( map(make_rotation(i), list(s)) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi This is regarding selenium automation I am trying to switch between tabs using window handler could you tell me what am I doing wrong.
[3/14/16, 8:57:09 AM] akhoche: 1. go to Gmail
[3/14/16, 8:57:29 AM] akhoche: 2. open bing.com in next tab
[3/14/16, 8:59:14 AM] akhoche: I am using browser.execute_script('''window.open("http://bings.com","_blank");''')
[3/14/16, 8:59:37 AM] akhoche: to open new tab as Keys.COMMAND +’t’ is not working
[3/14/16, 9:00:49 AM] akhoche: Also, for switching between windows I am trying to use window handler but could not get it work.Could you please let me know what am I doing wrong and what needs to be done thanks.
[3/14/16, 9:01:02 AM] akhoche: browser = self.resource_handler.driver
browser.set_page_load_timeout(60)
browser.implicitly_wait(15)
browser.get("http://google.com")
main_window = browser.current_window_handle
#main_window = browser.getWindowHandle()