In [1]:
name = "TaeHo"
age = 27
In [2]:
print(f"Hello, {name}. You are {age}.")
print(f'{name:20}')
print(f'{name:>20}')
print(f'{name:*<20}')
print(f'{name:*>20}')
print(f'{name:*^20}')
number = 3.141592653589793
print(f'{number:.2f}')
In [1]:
In [2]:
print(f"Hello, {name}. You are {age}.")
print(f'{name:20}')
print(f'{name:>20}')
print(f'{name:*<20}')
print(f'{name:*>20}')
print(f'{name:*^20}')
number = 3.141592653589793
print(f'{number:.2f}')
Hello, TaeHo. You are 27.
TaeHo
TaeHo
TaeHo***************
***************TaeHo
*******TaeHo********
3.14
name = "TaeHo" age = 27
Hello, TaeHo. You are 27. TaeHo TaeHo TaeHo*************** ***************TaeHo *******TaeHo******** 3.14
'부스트캠프 AI Tech > Python' 카테고리의 다른 글
[06] Class, Inheritance, Visibility (0) | 2022.01.13 |
---|---|
[05] 가변인자 (0) | 2022.01.12 |
[04] Black으로 파이썬 코드 스타일 통일하기 (0) | 2022.01.12 |
[03] 문자열 함수 정리 (0) | 2022.01.12 |
[02] if __name__=="__main__" (0) | 2022.01.12 |