How to fix this? This is my code:
# function for calculating kinetic energy
def cal_kinetic_energy(m, v):
# kinetic energy formula
KE = 0.5 * m * v**2
return KE
# main function
def main():
# input mass from user
m = input("Please enter the mass (kg): ")
# input velocity from user
v = input("Please enter the velocity (m/s): ")
# call kinetic energy method
print( cal_kinetic_energy(m, v), "is the calculated kinetic energy")
# call main
main()
but
Syntax errors detected :
Line 5:
return KE
^
SyntaxError: ‘return’ outside function