2016年7月の日曜日の日付だけを出力するプログラムを記述してください。
//出力例 1 3,10,17,24,31 //出力例 2 3 10 17 24 31
// python3 import calendar cm = calendar.monthcalendar(2016, 7) sundays = set(w[-1] for w in cm) target = set(map(int, input().split(','))) print('\n'.join(map(str, sorted(target - (target - sundays)))))