format() 함수
정수 형태로 출력: # 포맷 함수 사용 format출력 = "{}".format(10) print(type(format출력), format출력) # 숫자를 문자열로 변환하여 출력하기 print("{} {} {}".format(1, 2, 3, 4)) # 차례대로 해당 위치에 맞게 대치 print("{}{},{}".format(1, 2, 3, 4)) # 띄여쓰기와 쉼표의의 차이 # 결과값: 10 1 2 3 12,3 정수 형태로 출력: x = "{:d}".format(2019) # 정수 출력 y = "{:5d}".format(2019) # 5칸으로 출력 z = "{:10d}".format(2019) # 10칸으로 출력 xx = "{:010d}".format(2019) # 10칸에 양수 빈칸은 0으로 채우기 y..
2019.08.12