📜  while循环奇数python代码示例

📅  最后修改于: 2022-03-11 14:45:12.408000             🧑  作者: Mango

代码示例1
# Python Program to Print Odd Numbers from 1 to N

maximum = int(input(" Please Enter the Maximum Value : "))

number = 1

while number <= maximum:
    if(number % 2 != 0):
        print("{0}".format(number))
    number = number + 1