求1到100( 不包含100)包含几个偶数

'''
for循环 求1到100中有几个偶数

'''
count=0
for x in range(1,100):
    if x%2==0:
        count+=1
print(""+str(count)+"个偶数")

 

posted @ 2023-03-28 22:55  胖豆芽  阅读(27)  评论(0编辑  收藏  举报