250x250
반응형
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 |
Tags
- grad-cam
- 공분산
- Airflow
- UDF
- API
- Counterfactual Explanations
- API Gateway
- TensorFlow
- XAI
- login crawling
- 상관관계
- requests
- youtube data
- 유튜브 API
- GCP
- airflow subdag
- Retry
- tensorflow text
- session 유지
- GenericGBQException
- top_k
- integrated gradient
- spark udf
- subdag
- hadoop
- gather_nd
- correlation
- flask
- BigQuery
- chatGPT
Archives
- Today
- Total
데이터과학 삼학년
f-string escape string (중괄호를 나오게 하려면) 본문
반응형
Braces (중괄호)
f-string을 쓸 때, 중괄호가 나오게 하려면 중괄호를 2개 쓰면 된다.
f"{{70 + 4}}"
# '{70 + 4}'
중괄호를 3개쓰면, single brace의 결과가 산정되고, 중괄호 표시가 string 상으로 나타남
f"{{{70 + 4}}}"
#'{74}'
중괄호를 3개 초과해서 사용하면 단순히 중괄호가 스트링 그 자체로 나타남
f"{{{{70 + 4}}}}"
#'{{70 + 4}}'
https://realpython.com/python-f-strings/
Python 3's f-Strings: An Improved String Formatting Syntax (Guide) – Real Python
As of Python 3.6, f-strings are a great new way to format strings. Not only are they more readable, more concise, and less prone to error than other ways of formatting, but they are also faster! By the end of this article, you will learn how and why to sta
realpython.com
728x90
반응형
LIST
'Python' 카테고리의 다른 글
리스트 정렬 (multiple key를 이용한 정렬) (0) | 2021.09.22 |
---|---|
First-class function (일급함수) (0) | 2021.09.15 |
클래스를 이용하여 데커레이터 만들기 (0) | 2021.04.15 |
데커레이터 다수 지정할때 실행 순서?! (0) | 2021.04.15 |
정규 표현식 기초 (퍼옴) (0) | 2021.03.23 |
Comments