python-3.x - 为什么我得到无效字符
问题描述
我正在使用 GPS 传感器和 Raspberry Pi 3b+ 运行一个简单的代码,并希望对读数执行一些计算,我得到的唯一错误是“SyntaxError:标识符中的无效字符”,但该行看起来很简单。
def Tasks():
def CalculateSpeed():
if x[-1] and y[-1] == even:
ChangeInLatitude=x1-x
DistanceConversion=ChangeInLatitude*111111
Speed=DistanceConversion/TimeElapsed
Speed=str(speed) + meters/interval
print (“The object this module is attached to is moving at “ + Speed)
错误代码将错误标记放在第 8 行“the”的末尾
解决方案
你有 unicode 引号。
foo = “bar“
无效也不是
foo = “bar”
但是单引号或双“基本”引号是:
foo = "bar"
推荐阅读
- google-cloud-platform - GCP cloudbuild git推送触发器
- android - 我无法让 Flutter 通知图标正常工作
- python - 打开从 .py 文件创建的 exe 文件后是否可以关闭 cmd?
- google-apps-script - GoogleScript - 在 MailApp 中更改“发件人”
- c# - XML 到 SQL 实体框架
- android - CMake库中的公共源文件
- machine-learning - 进行多标签分类的更有效方法?
- python - 导入cv2时,python 3.7,Anaconda 4.9.2出现libgio2.0错误
- c# - Unity C# - 儿童旋转和位置断开
- python - 机器人框架以不同的值置换相同的步骤