f-string 이란 formatted stirng literal 의 약자라고 한다
사용법
- 문자열 앞에 f 를 붙임
score = 0
height = 1.8
isWinning = True
#f-string
print(f"your score is {score}, your height is {height}, you ar winning is {isWinning} ")'Python 🎧' 카테고리의 다른 글
| [python] 반복문 for - 배열 가장 높은수/짝수만 더하기/fizzbuzz게임/랜덤 비밀번호 생성기 (0) | 2024.08.05 |
|---|---|
| [python] 배열 - append/extend 차이 (3) | 2024.08.04 |
| [python] random 모듈 - 임의의 수 선택하기 (2) | 2024.08.04 |
| [Python] BMI 계산기 - 정수변환/상수변환/문자변환/수식 (2) | 2024.07.23 |
| [Python] 입출력 - input/output (0) | 2024.07.15 |