#求100内奇数和whilefor..in循环
sum
=
0
i
=
1
while
i <
=
100
:
sum
+
=
i
i
+
=
2
print
(
sum
)
sum
=
0
#range函数end时不包括当前数值,所有注意101.
for
i
in
range
(
0
,
101
,
2
):
sum
+
=
i
print
(
sum
)
#求100内奇数和whilefor..in循环
sum
=
0
i
=
1
while
i <
=
100
:
sum
+
=
i
i
+
=
2
print
(
sum
)
sum
=
0
#range函数end时不包括当前数值,所有注意101.
for
i
in
range
(
0
,
101
,
2
):
sum
+
=
i
print
(
sum
)