본문 바로가기
Python

0630 python - print( )

by 대금부는개발자 2021. 6. 30.
SMALL

 

출력할 때 print( )

print( )는 인자로 들어오는(괄호 안에 들어오는) 데이터를 문자열로 변환해서 출력하는 함수

 

a = 100

print(a) # 100 ← 내부적으로 변환해서 숫자 100이 아닌 문자열 100

기본적인 print( ) 함수는 출력 후 line feed(한 줄을 띄어요) 해요!

 

print( 'Hello')

#Hello

 

print('Hello', end=' ')

#Hello

 

print('world') Hello World (가운데 공백은 end=' ' 덕분이에요!!)

 

 

print('Hello', end='*')

print('world') #Hello*world 첫 번째 인자를 찍고 빈칸(공백)에 * 찍으세요

 

print('Hello', end='\n')

print('world')

#Hello

world

 

 

 

 

 

 

LIST

'Python' 카테고리의 다른 글

0701 python control statement(제어문) 정리  (0) 2021.07.01
0701 python built- in data type 정리  (0) 2021.07.01
0630 python - control statement (제어문)  (0) 2021.06.30
0630 python Bool  (0) 2021.06.30
0630 - python Set type  (0) 2021.06.30

댓글