목록Format (3)
개발은 처음이라 개발새발
print 옵션 중에 가장 중요한 것이라고 하면 format 함수이지 않을까 생각됩니다. format 함수의 기초 예저에 대해 정리해보겠습니다. https://python-course.eu/python-tutorial/formatted-output.php 22. Formatted Output | Python Tutorial | python-course.eu22. Formatted Output By Bernd Klein. Last modified: 08 Nov 2023. Many Ways for a Nicer Output In this chapter of our Python tutorial we will have a closer look at the various ways of creating nicer ..
https://python-course.eu/python-tutorial/formatted-output.php 22. Formatted Output | Python Tutorial | python-course.eu22. Formatted Output By Bernd Klein. Last modified: 08 Nov 2023. Many Ways for a Nicer Output In this chapter of our Python tutorial we will have a closer look at the various ways of creating nicer output in Python. We present all the different ways, but wpython-course.euformat..
1. format함수와 형식문자를 이용한 데이터 출력 userName = '최윤식' userAge = 31 print('user name : {}, user age: {}'.format(userName, userAge)) #순서 바꾸기 print('user name : {1}, user age: {0}'.format(userName, userAge)) ###format 함수는 {}안에 인덱스 번호를 기입해 순서를 변경할 수 있다. ### #형식문자열 print('user name: %s' % userName) print('user age: %d' % userAge) print('user name: %s, user age: %d' % (userName, userAge)) ##### %s: 문자열, %d: ..