首页 > 解决方案 > 有谁知道在我的 python 程序中在哪里修复这个错误?

问题描述

这是我在 Python 中的第一个程序之一,不知何故,这个脚本无法编译。

company_name = "coding temple, inc."
company_address = "283 Franklin St."
company_city = 'Boston, MA'

 #declare ending message
message ="Thanks for shopping with us today!"
#create the a top border
print("*"*50)

print(" \t\t{ }".format(company_name.title()))
print(" \t\t{ }".format(company_address))
print(" \t\t{ }".format(company_city))

解释器在第 11-13 行标记“关键参数''没有相应的参数”

标签: python

解决方案


您需要像下面粘贴的第一行代码一样提供争论的索引。或者最好使用第二行中的f 字符串

print(" \t\t{0}".format(company_city))
print(f" \t\t{company_city}")

推荐阅读