# Paste candidates code for part 1 below this line # And above this line # Paste candidates code for part 2 below this line # And above this line # Don't touch any of this: if most_common_letter('caats') == 'a' and most_common_letter('CAATS')=='a' and most_common_letter('caaampPpPfire')=='p': print "pass part 1" else: print "fail part 1" test1 = [3,7,4,9,12] test2 = [9,8,7,6,5] test3 = [10,20,30,40,50] sol1 = [144, 81, 49, 16, 9] sol2 = [81, 64, 49, 36, 25] sol3 = [2500, 1600, 900, 400, 100] cand1 = ordered_squares(test1) cand2 = ordered_squares(test2) cand3 = ordered_squares(test3) if cand1 == sol1 and cand2 == sol2 and cand3 == sol3 and test1 == [3,7,4,9,12] and test2 == [9,8,7,6,5] and test3 == [10,20,30,40,50]: print 'pass part 2' else: print 'fail part 2'
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question