Tatoheba
print "year:%d, month:%d, day:%d" % (year, month, day)
That is, the operator'%' is the heart of it. The operator'%' means modulo operation in the value, but overloads it as a format in the Unicode string. In "format% values", the% conversion specification in format is replaced by 0 or more elements in values.
By the way, in C ++ boost :: format ()
std::out << boost::format("year:%d, month:%d, day:%d") % year % month % day;
Recommended Posts