Python 3.x python赢得了';I don’我不能解我的方程式,我怎样才能把它修好呢?

Python 3.x python赢得了';I don’我不能解我的方程式,我怎样才能把它修好呢?,python-3.x,Python 3.x,这是我的代码,也是我的第一个课堂作业,我完全被卡住了,在解方程时,我收到一条错误消息,有人能帮我吗 错误代码:回溯(最近一次呼叫上次): 文件“program1_MaxF.py”,第14行,在 求解(yVelocityt-.5g*t**2) 名称错误:未定义名称“求解”根据公式,您正在计算给定起始速度和行程时间的对象的新速度和位置 你可能想要这样的东西: def my_function(parameter): print(parameter) my_function("

这是我的代码,也是我的第一个课堂作业,我完全被卡住了,在解方程时,我收到一条错误消息,有人能帮我吗

错误代码:回溯(最近一次呼叫上次): 文件“program1_MaxF.py”,第14行,在 求解(yVelocityt-.5g*t**2)
名称错误:未定义名称“求解”

根据公式,您正在计算给定起始速度和行程时间的对象的新速度和位置

你可能想要这样的东西:

    def my_function(parameter):
    print(parameter)
my_function("Maxwell Filipe")
my_function("Program 1 Projectile Motion Formulae")
my_function("2/9/2020")
my_function("Program that will solve simple Projectile Motion Equations")
my_function("Choose the values for time, yVelocity, and xVelocity")
time = input()
g = 9.8
yVelocity = input()
units='m/s'
xVelocity = input()
import math
solve(yVelocity*time-.5*g*t**2)
solve(xVelocity*time)
solve(yVelocity-g*t)

请发布完整的错误回溯。回溯(最后一次调用):文件“program1_MaxF.py”,第14行,在solve(yVelocityt-.5*gt**2)name错误:名称“solve”未定义请在帖子中发布所有回溯,而不是在评论中。Fwiw,你还没有导入solve我如何导入solve?我刚刚转载了它。你还没有定义
解算
,也不清楚你希望它做什么。python标准库中没有内置的
solve
函数,我们无法猜测您可能会使用其他库。如果这是一个家庭作业,也许你应该检查你的笔记,看看你希望在这门课上使用什么库,或者问问你的老师?
def my_function(parameter):
    print(parameter)
    
my_function("Maxwell Filipe")
my_function("Program 1 Projectile Motion Formulae")
my_function("2/9/2020")
my_function("Program that will solve simple Projectile Motion Equations")
my_function("Choose the values for time, yVelocity, and xVelocity")

time = float(input('Time? '))
yVelocity = float(input('Y Vel? '))
xVelocity = float(input('X Vel? '))

g = 9.8
units='m/s'

import math
height = yVelocity*time-.5*g*time**2
distance = xVelocity*time
vspeed = yVelocity-g*time

print(f'Height={height} Distance={distance} YSpeed={vspeed}')