Question: Given the contents of the file as follow:

```
Company1 400
Company2 500
Company3 600
Company2 150
Company1 350

```

Write a script command to find the total cost incurred by Company1.

Answer: 
[Floating point numbers are not precise.](https://stackoverflow.com/questions/588004/is-floating-point-math-broken) The more you handle them, the more error they can accumulate. To have numbers you want, the best way is to keep things integral for as long as possible:

```
def number():
    b = 1
    while True:
        yield b / 10.0
        b += 1

```
Like this?

```
for i in range(10):
    AnotherB=next(b)
    c=AnotherB*2

    print(AnotherB)
    print("c="+str(c))

```

or do you mean how do you reset a yeild?
just redeclare it.

```
def number():
    b = 0.1
    while True:
        yield round(b,1)
        b = b + 0.1

b = number()
for i in range(10):
    print(next(b))

b=number()
for i in range(10):
    print("c="+str(next(b)*2))

```