Python- TypeError object int is not iterable
Question: Here is my code, when I am running it I get error on line 19 (for loop):
TypeError: object 'int' is not iterable.

    
    
    import fb 
    from facepy import GraphAPI 
    
    
    token=""# access token here.  
    facebook=fb.graph.api(token)
    graph1 = GraphAPI(token)
    vid="" #page  id here
    query=str(vid)+"/feed"
    r=graph1.get(query)
    count=0
    nos=input("Enter number of posts: ")
    for indid in nos:
          count=count+1
         facebook.publish(cat="feed",id=indid,message="Hi"+str(count))
      time.sleep(6)
      print("Wall post:"+str(count))
    
    else :
       print("No posts made.")
    

Please tell me what's wrong.


Answer: Well, the error says it all: you try to iterate over an `int` in the `for`
loop of this code:

    
    
    nos=input("Enter number of posts: ") # nos is an int here
    for indid in nos: # and this is not how you iterate over an int
          count=count+1
         facebook.publish(cat="feed",id=indid,message="Hi"+str(count))
    

make a range instead:

    
    
    for count in range(0, nos):
         facebook.publish(cat="feed",id=count,message="Hi"+str(count))
    

furthermore: I don't know what you try to do with `indid`. Maybe you also want
to ask for the postid you want to change...

