A
A
Alexey Poloz2017-06-25 14:18:17
Python
Alexey Poloz, 2017-06-25 14:18:17

Python Moved object processing into a function - why doesn't it work?

Everything worked, but it was necessary to move the processing of the object into a separate function
. The following error appeared:

TypeError: unsupported operand type(s) for *: 'float' and 'method'

b35a9d51e137405eb2cf65f4a113e9fb.pngCODE
How to call:
for i in api.followers(u):
  f=subscribe(i, me, s)

How I process:
def subscribe(i, me, s=[]):
  if i.followers_count>=0.5*i.friends and i.followers_count>=5000: #Ошибка здесь

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Romanov, 2017-06-25
@kosyachniy

The screenshot tells me that friends is a method, so you need to write friends()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question