LoginSignup
0
2

More than 5 years have passed since last update.

Python > print時の書式指定`%` > "%s %s" % ('Hello', 'World',)

Last updated at Posted at 2016-10-29
動作環境
Ubuntu 14.04 LTS desktop amd64
GeForce GTX 750 Ti
ASRock Z170M Pro4S [Intel Z170chipset]
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v7.5
Python 2.7.6
IPython 5.1.0 -- An enhanced Interactive Python.

TensorFlowというDeep Learningのフレームワークを学習中。

TensorFlowを遊び倒す! 4-1. Convolutional Neural Networks
http://blog.brainpad.co.jp/entry/2016/04/22/170000

CIFAR-10のデータセットを処理するTutorialを読んでいる。

cifar10_train.py
...
        format_str = ('%s: step %d, loss = %.2f (%.1f examples/sec; %.3f '
                      'sec/batch)')
        print (format_str % (datetime.now(), step, loss_value,
                             examples_per_sec, sec_per_batch))
...

print時の書式指定に%を使うようだ。
http://postd.cc/new-string-formatting-in-python/

0
2
7

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2