age = 17
print(str(age)+ "살" )--> 17살
print( "{}살" .format(age))--> 17살
year=2010
month=10
day=15
date_string="오늘은 {}년 {}월 {}일 입니다.";
print( date_string.format( year , month, day )
// 오늘은 2010 년 10 월 15 일 입니다. --> 출력
'program > python' 카테고리의 다른 글
[python] type 함수 (0) | 2024.01.28 |
---|---|
[python] fomat 다루기 (0) | 2024.01.28 |
[python] 형변환 (0) | 2024.01.28 |
[python] 문자열 (0) | 2024.01.28 |
[python] 버림나눗셈 // floor division (0) | 2024.01.27 |