TIL 08. Python - String 연산

박소윤·2020년 11월 18일
0

Python

목록 보기
6/6
post-thumbnail

# 숫자와 비슷한 String + String

print("Hello, World") == print("Hello" + "World") 

== 
name = input()
print("Hello, " + name)

# 복잡한 String concatenation

literal string interpolation
name = input()
print(f"Hello, {name}")

문법 사용 정의
1. print(f"") : 파이썬은 f 다음에 오는 string 값을 literal string interpolation으로 인지하며,
    string 안에 있는 변수들을 실제 값으로 치환.

  1. 치환할 변수(or 함수호출 ...) 중괄호() 사용.

[ TIL 05. Python - Literal String Interpolation ]


# Significant Whitespace (들여쓰기)

Python은 TAB(space 4)사이즈를 기준으로 모든구분에 사용

profile
흐르듯 그리는 Front-end

0개의 댓글