Question: So i'm currently on a course, and one of the objectives for today is to recreate the fizzbuzz game, using a for loop and ranges. I think I pretty much have the objective down but am getting a type error and am too stubborn to look up a solution.

This is my current code:

```py
total = 0
for number in range(1, 101):
    if total % 3 == 0:
        total = 'Fizz'
    elif total % 5 == 0:
        total = 'Buzz'
    elif total % 3 and 5 == 0:
        total = 'Fizz Buzz'

    print(number)

```

This is the error I am receiving:

```
line 3, in <module>
    if total % 3 == 0:
TypeError: not all arguments converted during string formatting

```

Anyone able to point me in the right direction as to what I am doing wrong? I'm stumped and have tried adding str() to certain parts to see if that fixes the issue.

Currently using python 3.9.1 and am using vs-code to code in.

Edit: thanks for all the helpful prods and suggestions, figured it out :)

Answer: 
Expanding on the comment from @rdas:

In the first execution of the loop:
`total = 0`
so in the first if statement the condition is true `(0%3 ==0)`
which sets `total` to 'Fizz' on line 4.

In the second execution of the loop:
`total = 'Fizz'`.
So as suggested, `total` is a string at this point and for strings the `%` is used for [string formatting](https://realpython.com/python-string-formatting/).
Since 3 is not a valid set of arguments for `total` as a format string you get the error that you're seeing.

That being said, this probably means that there's a problem with how total is being used in your code!
Its because you are setting total to a string, then using a `%` operator on that.

For integers, `%` means mod, for strings it is part of the formatting for printing them.

If you print out the value of number in your loop you can see it gets round the loop the first time, then breaks when total has been changed to a string.