2016-06-23から1日間の記事一覧

PythonでHit&Blow

import random # 0から9までのリスト作成 ans = [i for i in range(10)] # リストをシャッフル random.shuffle(ans) # print(ans[:4]) while True: n = int(input('4桁の数字を入力してください?')) if n < 10000: hit = 0 blow = 0 # 桁ごとに分解 n_list =…