Python FizzBuzz

后端 未结 8 804
刺人心
刺人心 2020-12-20 10:34

I have been given this question to do in Python:

Take in a list of numbers from the user and run FizzBuzz on that list.

When you loop through the list rememb

8条回答
  •  无人及你
    2020-12-20 11:38

    n % 3 (or n % any number) does not evaluate to True or False, it's not a Boolean expression. n % 3 == 0 on the other hand, does.

    As an aside, what happens when n % 3 == 0 and n % 5 == 0 both evaluate to True?

提交回复
热议问题