1 需求 使用Python中的循环打印输出从1到100的所有奇数。 2 代码实现 class Solution: def PrintTheOdd(self): index = 1 while index <= 100: print(index) index += 1 if __name__ == "__main__": solution = Solution() solution.PrintTheOdd()