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
for i in range(6561): #6561=3^8 | |
numli = [1,2,3,4,5,6,7,8,9] #計算式に出てくる数字 | |
calcli = [] #+を0,-を1,xを2として3進法8桁で演算子を表す | |
while i != 0: | |
calcli.append(int(i%3)) | |
i = int(i/3) | |
if(len(calcli)<8): #8桁に足りない部分は全部0にする | |
for j in range(8-len(calcli)): | |
calcli.append(0) | |
calcli.reverse() #全通り試すのでなくてもいい |
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 python3 | |
# -*- coding: utf-8 -*- | |
s = "".join(i+j for i, j in zip('パトカー', 'タクシー')) | |
print(s) |
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 python3 | |
# -*- coding: utf-8 -*- | |
letters = "パタトクカシーー" | |
print(letters[::2]) |
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 python3 | |
letters = "stressed" | |
print(letters[::-1]) |