TypeError: 'float' object not iterable




I'm using python 3.2.2 on windows 7 and I'm trying to create a program which accepts 7 numbers and then tells the user how many are positive, how many are negative and how many are zero. this is what I have got so far:



```
count=7
for i in count:
    num = float(input("Type a number, any number:"))
    if num == 0:
        zero+=1
    elif num > 0:
        positive+=1
    elif num < 0:
        negative+=1

print (positive)
print (negative)
print (zero)

```

But when I run the code I get 



```
TypeError: 'float' object is not iterable

```

If I replace float in line 3 with int I get the same problem except it says that the 'int' object is not iterable. I have also tried changing the value of count from 7 to 7.0


Now I took this challenge from a python tutorial book and they don't have the answer, and from what I can tell I have done everything within the syntax they put forward.


[The tutorial is here (PDF)](http://cs.simpson.edu/files/CS_Intro_Book.pdf)
`for i in count:` means `for i in 7:`, which won't work. The bit after the `in` should be of an iterable type, not a number. Try this:



```
for i in range(count):

```
you are mixing up "for all iterators i" with "for some specific kind of iterator i".

what if i decide to call foo<std::vec::intoiter<string>>? then you have a function that takes an intoiter<string>, but you tried to call it with an skip<intoiter<string>>, which is a different type. hence a type mi… the compiler will throw the following errors:  


10: error: increment of read-only variable **k**,  


12: error: **lvalue** required as increment operand. From the [Library Reference](http://docs.python.org/2/library/stdtypes.html#set-types-set-frozenset):



> 
> The set type is mutable — the contents can be changed using methods like add() and remove().
> 
> 
> [image] endermaz41:

didn't know what to put in the error portion

first of all, err(…) is a value, not a type. since err is a variant ("constructor" if you like) of enum result, if you invoke it, you get a value of type result. you won't get a value of the error type itself, much less a type.

… Your explanation is not consistent. You state that the user is to enter a range as in "find me all numbers between x and y that are divisible by both 3 and 4." Later you state that you "input value 120 10 times". That is inconsistent with the problem so either the problem is stated incorrectly or you are not inputting the expected data. Decide what is the correct problem then write it up in pseudo-code before you write the actual code.


If a range is expected, make sure you test that it is a valid range (x <= y). >printf("%c", len\_char); //<this does not print anything too!!  

What did you expect it to print? You realize that the %c format modifier takes the integer value you supply and prints the character representation of that integer, right? In other words, it's not going to print '3'...ever. As long as the lengths are single digits, you can say len\_char + '0' and get the correct representation, but once the length exceeds 9, you're SOL with this method. to find: limitsnote: first check the form of imit. used this method if the limit is satisfying any one from 7 indeterminate form.in this case, indeterminate form is formula used: = 1so, by using the above formula, we have = = therefore, = not sure i understood. are you having problems with this code?

if yes, i think you’re using the wrong comparison operator (not = but ==). method a.increment() overlaps in class b.   
 therefore, regardless of the type of the variable obj, will be called the method corresponding to the actual type of the object - that is, b.increment().  
 
this method will use the variable i, declared in the same class b and having an initial value of 10.  
 
the resulting value - 11. Check if any of the values in the cells are null.  

If they are you need to modify your code to check for null conditions before using `ToString()`.