Troubleshooting Google colab

I just started. Google colab is having some issues outputting some of the codes I type up, even if I copy word for word from the YT videos. It keeps saying “int” object is not callable.

Here is the code from one of the lessons trying to solve for “x”.

import sympy
from sympy import symbols
from sympy.solvers import solve

x = symbols(‘x’)

#put equation here
eq = x - 2

print(“x =”,solve(eq,x))

For the output all i get is ““int” object is not callable.”
I am completely new to python and google colab. Any help with this will be much appreciated.

I pasted this into google colab, I got the result:

x = [2]

Screenshot 2023-09-07 152845

Can you share a screenshot of your code and error?

Thank you! I was misaligned.

1 Like

Indentation is everything in Python

1 Like