print( )函数打印string、number方式:
##字符串打印方式:
char = 'a'
num = 123
##使用字符串格式化(% 操作符):
print("The character is %c and the number is %d" % (char, num))
##使用str.format()方法:
print("The character is {} and the number is {}".format(char, num))
##使用f-string(Python 3.6+):
print(f"The character is {char} and the number is {num}")
##使用字符串拼接:
print(f"The character is {char} and the number is {num}")
##使用join()方法:
parts = ["The character is ", char, " and the number is ", str(num)]
print("".join(parts))