Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
snow feng committed Dec 13, 2024
2 parents 1bb7009 + de8c832 commit 109dfe1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CartonPython/lesson5/ch5_2_2_1_snow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
for item in '我是你爸爸':
print(item)

numbers = [54188 ]
numbers = [88 ]
print("---------整数列表---------")
for item in numbers:
print(item)
7 changes: 7 additions & 0 deletions CartonPython/lesson5/ch5_3_2_fcpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8
# Filename: ch5_3_2.py

for item in range(10):
if item ==0 or item == 2 or item == 4 or item == 6 or item == 8:
continue
print(item)
2 changes: 1 addition & 1 deletion CartonPython/lesson5/ch5_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

i = 198; r = 0; s = 0; t = 0

while i < 1000:
while i < 2000:
r = i // 100
s = (i - r * 100) // 10
t = i - r * 100 - s * 10
Expand Down
13 changes: 13 additions & 0 deletions CartonPython/lesson5/ch5_4_for_fcpp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# coding=utf-8
# Filename: ch5_4_for_fcpp.py

i = 100; r = 0; s = 0; t = 0

while i < 5000000:
r = i // 100
s = (i - r * 100) // 10
t = i - r * 100 - s * 10
if i == (r ** 3 + s ** 3 + t ** 3):
print("i = " + str(i))

i += 1

0 comments on commit 109dfe1

Please sign in to comment.