파일 다운로드 |
def fnSumAct(n): if n==1: return 1 else: return fnSumAct(n-1)+n #재귀 호출은 1000번으로 제한함 ''' 천번 이상 재귀 호출시 import sys sys.setrecursionlimit(n) #n=최대횟수''' run=1 while(run==1): vN=int(input("숫자입력! : ")) print(fnSumAct(vN)) print("") |
728x90
'■ 현재-ing > ㅡPython' 카테고리의 다른 글
파이썬 텍스트파일 읽어오기, open,r,w,a,encoding,read,readline,row (0) | 2020.07.07 |
---|---|
파이썬 window, command=quit, mainloop, 사진, messagebox, file (0) | 2020.07.06 |
파이썬 사용자정의함수 (0) | 2020.07.06 |
파이썬 turtle, write, title, onkeypress, up, down, space, left, right (0) | 2020.07.06 |
파이썬 점(dot), color 두가지 변수 사용, begin_fill, end_fill (0) | 2020.07.06 |