(1) print("First number is {} and second number is {}".format(first, second))
(1b) print("First number is {first} and number is {second}".format(first=first, second=second))
或者
(2) print('First number is', first, 'second number is', second)
(注意: 与逗号分开后会自动添加空格)
或者
(3) print('First number %d and second number is %d' % (first, second))
或者
(4) print('First number is ' + str(first) + ' second number is' + str(second))
如有需要,最好使用 格式() < a href = “ http://docs.python.org/library/stdtypees.html # str.format”rel = “ noReferrer”> format () (1/1b)。