python - 有谁知道在我的 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 行标记“关键参数''没有相应的参数”
解决方案
您需要像下面粘贴的第一行代码一样提供争论的索引。或者最好使用第二行中的f 字符串。
print(" \t\t{0}".format(company_city))
print(f" \t\t{company_city}")
推荐阅读
- javascript - 使用 javascript 对格式 00:00:00.000 的两个时间参数求和
- c# - C# 和 C++ dll - 编组字符串
- android-studio - Android Studio 没有显示 xml 编辑器
- macos - 如何使用 SwiftUI 在 MacOS 上配置多选分段控制
- relative-path - 相对文件路径暗示不同的文件夹结构?
- android - 崩溃 github.com/siralam/LoopingViewPager Android 工作室
- elixir - 如何通过 Elixir 中的索引同时从列表中删除多个项目?
- vb.net - 如何为 AddressOf CalledBack 添加委托?
- python - Using Python Popen to run command with mulitple inputs
- html - 从 HTML 中的动态数组中选择一个随机元素