Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- Android
- 터치순서
- 힐트
- databinding error
- {"msg":"cannot find method
- 원생성
- 안드로이드 다이얼로그 오류
- Python
- @provides @binds 차이
- onIntercepterTouchEvent
- isFinishing()
- material3
- WindowManager$BadTokenException
- 원이동
- 듀얼시크바
- Could not find method
- databinding xml
- 안드로이드
- [databinding]
- android.view.WindowManager.BadTokenException
- rangeslider
- multiseekbar
- 지오코더
- Java
- dispatchTouchEvent
- android compose
- 도형생성
- 레트로핏
- dualthumbseekbar
- 터치이벤트 순서
Archives
- Today
- Total
개발관련일지
PY ] 파이썬 포메팅 ( formatting ) 본문
파이썬으로 mysql CRUD query 찾다보니 포메팅 방식을 사용하고 있어서 찾아봄
format > 사전적의미 > 구성방식 , 책의 판형 , 컴퓨터포멧 서식
formatting > 사전적의미 > 서식 설정
퍼센트 연산자를 사용해 문자열에 숫자, 문자열에 대입을 시켜줌
%d %f %s 을 사용함 >> C언어에서 사용해서 C방식이라고 부른다함
str = "hello %s" % "world"
print(str)
#hello world
int = '%d %d' % (1, 2)
print(int)
#1 2
float = '%f' % 1.414
print(float)
#1.414000
파이썬에선 format() 연산자를 제공함
format_str = 'hello {}'.format('world')
print(format_str)
#hello world
format_int = '{} x {} = {}'.format (9, 5, 9*5)
print(format_int)
#9 x 5 = 45
format_order = '{1} x {0} = {2}'.format (9, 5, 9*5)
print(format_order)
#5 x 9 = 45
'개발기록 > PYTHON' 카테고리의 다른 글
PY ] 판다스 자주 사용하는 코드 정리 (0) | 2020.07.21 |
---|