본문 바로가기

프로그래밍/Python

Python 으로 C언어 printf 함수 구현

반응형

가변인수를 사용하여 구현


>>> def printf(format , *arg):

print format % arg


>>> printf("%d + %d = %d ",1,2,3)

1 + 2 = 3 


반응형

'프로그래밍 > Python' 카테고리의 다른 글

anaconda 가상환경 생성  (0) 2020.07.13
발생자  (0) 2015.08.03
파일에서 라인단위로 읽어오기  (0) 2015.08.03