Light weight solution showing time inefficiency

why does light weight solution in python showing time inefficiency and whether the time complexity of question in both python and C++ is calculated differently ?
I am a data science enthusiast, is it okk if i do competitive coding in python?

The lightweight solution in Python2.7 could be optimized a bit.
First, instead of using a list() for list_row and list_col you can use a set(). Thereby, you can get rid of the if elem in list_* already logic because a set guarantees you uniqueness.
Second, you can continue after a full row was set to 0. Most likely, this will save a lot of time due to all A[i][j]'s are set to 0 already.

for i in xrange(n):
  if i in list_row:
    A[i] = row
    continue
  for j in xrange(m):
    if j in list_col:
      A[i][j] = 0
Click here to start solving coding interview questions