When I run anything other than your print("Hello, World") the terminal prints the following:
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/juliuseners/.vscode/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/Users/juliuseners/.vscode/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/Users/juliuseners/.vscode/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file
runpy.run_path(target, run_name="__main__")
File "/Users/juliuseners/.vscode/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/Users/juliuseners/.vscode/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/Users/juliuseners/.vscode/extensions/ms-python.python-2022.16.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "/Users/juliuseners/pythondir/Chapter 1.py", line 14, in <module>
if dis>0:
TypeError: '>' not supported between instances of 'function' and 'int'
I fail to solve the problem, has anyone ran into this before?
Tried manually changing PATH using homebrews recommendations but somehow I cannot get this to work.
EDIT: Im adding the code I'm attempting to run below:
import math
#The quadratic is luckily solved for all coefficients a,b,c except for a=0: this diqualifies the equation as quadratic.
#I write the function based on following formula: x=(-b+/-sqrt(b^2-4*a*c))/2a
a=input("Enter a: ")
b=input("Enter b: ")
c=input("Enter c: ")
def findmyroots(a,b,c):
dis=b*b-4*a*c
sqrtdis=math.sqrt(abs(dis))
if dis>0:
print("The roots are:")
print((-b+sqrtdis)/(2*a))
print((-b-sqrtdis)/(2*a))
elif dis==0:
print("The roots are:")
print((-b)/(2*a))
else:
print("Roots are lateral")
if a==0:
print("Write a real quadratic please..")
else:1
findmyroots(a,b,c)