Python 程序:使用字符串格式打印元组
后浪云Python教程:
编写一个 Python 程序,使用字符串格式打印元组。以下是使用字符串格式打印元组项的方法。
# Print Tuple using string formatting
numTuple = (20, 40, 60, 80, 100, 120, 140)
print(numTuple)
print("Tuple Items are = {0}".format(numTuple))
print("Tuple Items are = %s" %(numTuple,))
print("Tuple Items are = %s" %(numTuple))
版权声明:
作者:后浪云
链接:https://www.idc.net/help/184221/
文章版权归作者所有,未经允许请勿转载。
THE END