Skip to content

Instantly share code, notes, and snippets.

@zigzackey
Created March 29, 2016 03:36
Show Gist options
  • Save zigzackey/422c4f5f089ea5308dda to your computer and use it in GitHub Desktop.
Save zigzackey/422c4f5f089ea5308dda to your computer and use it in GitHub Desktop.
# endを指定しない場合は,"\n"がデフォルト.最後に改行が行われる
print("hoge")
# endに空文字を指定すると,改行されない
print("hoge", end="")
# print()関数の引数は,複数に対応している.sepを指定しない場合,デフォルトでは結合文字は半角スペース.
print("foo", "bar")
#sepを指定することで,結合文字を変更することができる
print("foo", "bar", sep=",")
#勿論,sepとendは同時に指定可能です
#fileで指定したファイルオブジェクトに出力可能です
print("hogehoge", file=sys.stdout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment