일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- nav2 튜토리얼
- docker foxy
- ros2 튜토리얼
- 코드업
- Nav2 document
- ros2 development guides
- nav2 getting started
- ubuntu humble 설치
- nav2 development guides
- Python
- nav2 development guides
- humble docker
- humble getting started
- development guides
- ros2 foxy docker
- ubuntu ros2 설치
- humble development guides
- foxy nav2
- Foxy tutorial
- ros2 getting started
- humble 도커
- CODEUP 6073
- ROS FOXY 튜토리얼
- error
- nav2 dev contatiner
- ros2 remapping
- nav2 설치
- CodeUp
- ros2 foxy tutorial
- humble nav2
Archives
- Today
- Total
목록python 문자열 포맷팅 (1)
BAN2ARU
[Python] 문자열 포맷팅 - format 및 f-string(formated string literal)
python에서 문자열 포맷팅은 문자열 중간에 원하는 값(특정 변수)를 삽이하기 위하여 사용합니다. 만약에 학생 A(=70점), B(=55점), C(=85점)으로 시험평균점수가 70점일 때, 이를 print("학생들의 평균 점수는 70점입니다.")로 출력하는 프로그램이 있다고 가정해봅시다. 이를 70이라는 값 대신에 "avg = (A+B+C)/3"라는 변수로 넣는 방법에 대한 것입니다. 다음과 같이 변수로 지정해준다면 학생들의 시험 값(A,B,C)이 변하더라도 print에 직접 값을 수정할 필요없이 해당 부분이 avg 변수 값에 반영되어 출력이 될 것입니다! 그럼 각 방법에 대해 설명드리도록 하겠습니다. [각 방법은 % 연산자, str.fomat, f-string 순으로 작성되어 있으며, f-string..
Language/Python
2022. 4. 26. 19:21