Mon Jun 5 12:09:00 UTC 2023 inscode

上级 e7a39bf9
sum=0
for i in range(101):
sum += i
print(sum)
\ No newline at end of file
# 用 for 循环对 0 到 9 进行遍历
for i in range(0,10):
# 输出当前的 i 的值
print(i)
# 判断当前的 i 是否为偶数
if(i % 2 == 0):
# 如果 i 是偶数,输出 i 是偶数
print(str(i)+"是偶数")
else:
# 如果 i 不是偶数,输出不是偶数
print("不是偶数")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册