-
-
Save l1x/9f4c6d68e0a407185277 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
#flip | |
def flip(n): | |
print 1 - n | |
def flip2(n, m): | |
def sorted_union(list1,list2): | |
list3 = [x for x in list1 if x in list2] | |
return sorted(list(set(list3))) | |
def internal_permutation(number_digits, acc): | |
if number_digits == 0: | |
print acc | |
else: | |
for i in range(10): | |
internal_permutation(number_digits - 1, acc + '%d' % i) | |
def print_permutation(num_digits): | |
internal_permutation(num_digits, '') | |
print_permutation(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment