Programming/Python
1 2 print("Python study 026 day") #2022. 2. 1.Tue cs Python study 026 day 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import os def search(dirname): try: filenames = os.listdir(dirname) for filename in filenames: full_filename = os.path.join(dirname, filename) if os.path.isdir(full_filename): search(full_filename) else : ext = os.path.splitext(full_filename)[-1] if ext == '.py': print(full_filenam..
1 2 print("Python study 025 day") #2022. 1.29.Sat cs Python study 025 day 1 2 3 4 5 6 7 def threeFive(): result = 0 for n in range(1,1000): if n % 3 == 0 or n % 5 == 0: result += n return result threeFive() cs 233168 1 2 3 4 5 6 7 8 9 10 11 # 게시판 페이지 수 리턴하기 def getTotalPage(total, onePage): if total % onePage == 0: return total // onePage else : return total // onePage + 1 print(getTotalPage(30,..
1 2 print("Python study 024 day") #2022. 1.28.Fri cs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 def guGu(num): result = [] for i in range(1,10): result.append(i * num) return '%s에 대한 구구단'%num, result print(guGu(2)) def threeFive(): result = [] sum = 0 for i in range(1,100): result.append(3*i) result.append(5*i) result.append(f'3과 5의 {i}배수와') sum += 3*i + 5*i result.append(sum) result...