3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

문자

String

기능

모든 문자열은 기본적으로 유니코드입니다.

  • Escape characters
    \n: New line
    \t: Tab
    \r: Carrage return
    \0: Null string
    \\: back slash(\) in string
    \’: single quote mark in string
    \": double quote mark in string

  • String concatenation: "py"+ "tyon" → "python"

  • String repeatition: "py"* 3 → "pypypy"

  • String indexing: "python" [0] → "p"

  • String slicing: "python" [1:4] → "yth"

예제

Python
"string1"
'string2'

tp_log("st"+"ring")
#expected result: string
tp_log("str"* 3)
#expected result: strstrstr
tp_log("line1\nline2")
#expected result: line1
# line2
tp_log("\"string\"")
#expected result: "string"
tp_log("str"[0])
#expected result: s
tp_log("string"[1:3])
#expected result: tr


+, *

예제

Python
"Doosan"+ "Robotics" → "DoosanRobotics"
"Doo"* 3 → "DooDooDoo"


인덱싱 & 슬라이싱

예제

Python
" Doosan" [0] → "D"
" Doosan" [1:4] → "oos"