Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Pythonで「(」を出力したい
print "(" + var + ")"
しかし、それは言う:
TypeError: Unicode への強制: 文字列またはバッファが必要です。NoneType が見つかりました
誰かが私を助けることができますか?それはあまりにも難しいことはできません... -.-
使用string formatting:
string formatting
foo = 'Hello' print('({})'.format(foo))
それvarはNoneあなたが提供したものにあるようです。すべて正しいですがvar、文字列が含まれていません。
var
None
多分単純print "(" + str(var) + ")"ですか?
print "(" + str(var) + ")"