python) Concatenating Text Strings
3204 ワード
" Concatenating Text Strings "
文字列プラス記号
文字列を接続する必要がある場合
string+string形式で使用できます.
print("hello" + "world")
# 출력
실행결과> helloworld
literal string interpolation(必ずしも変数ではなく、関数呼び出しであってもよい.)
date = 1980
python_inventor = "Guido van Rossum"
location = "Centrum Wiskunde & Informatica"
country = "Netherlands"
print(f"""Python was conceived in the late {date}s
by {python_inventor} at {location} (CWI) in the {country} as a successor
to the ABC language (itself inspired by SETL), capable of exception handling
and interfacing with the Amoeba operating system.
Its implementation began in December 1989.""")
# 출력
실행결과>
Python was conceived in the late 1980s
by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor
to the ABC language (itself inspired by SETL), capable of exception handling
and interfacing with the Amoeba operating system.
Its implementation began in December 1989.
Reference
この問題について(python) Concatenating Text Strings), 我々は、より多くの情報をここで見つけました https://velog.io/@ssoulll/python-Concatenating-Text-Stringsテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol