Skip to content

Commit 926e11c

Browse files
author
LaoBian
committed
python循环实现gitlab狐狸头图标
1 parent f1c630a commit 926e11c

File tree

7 files changed

+321
-0
lines changed

7 files changed

+321
-0
lines changed

.idea/Python.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 208 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
# Python
22
python案例分享
3+
4+
案例一:python循环实现gitlab狐狸头图标
5+
*. *.
6+
*** ***
7+
***** *****
8+
.****** *******
9+
******** ********
10+
,,,,,,,,,***********,,,,,,,,,
11+
,,,,,,,,,,,*********,,,,,,,,,,,
12+
.,,,,,,,,,,,*******,,,,,,,,,,,,
13+
,,,,,,,,,*****,,,,,,,,,.
14+
,,,,,,,****,,,,,,
15+
.,,,***,,,,
16+
,*,.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import math
2+
for i in range(7,0,-1):
3+
for j in range(i-1):
4+
print(' ',end="")
5+
for k in range(15-2*i):
6+
if i==4 and k==0:
7+
print(".",end="")
8+
elif i<4 and k==0:
9+
print(" ",end="")
10+
elif i<3 and 2*i+k==14:
11+
print("*", end="")
12+
elif i < 3:
13+
print(",", end="")
14+
else:
15+
print("*",end="")
16+
for l in range(5+2*i):
17+
if l==0 and i==7:
18+
print(".", end="")
19+
elif i<3:
20+
print("*",end="")
21+
else:
22+
print(" ",end="")
23+
for k in range(15-2*i):
24+
if i==7:
25+
print("*.", end="")
26+
elif i==3 and k==0 or i<3 and k+2*i==14:
27+
print(" ", end="")
28+
# elif i<3 and k+2*i==14:
29+
# print()
30+
elif i<3 and k==0:
31+
print("*", end="")
32+
elif i<3:
33+
print(",",end="")
34+
else:
35+
print("*",end="")
36+
print("")
37+
for i in range(0,5):
38+
for j in range(math.ceil(3.3*i+1)):
39+
# if j==1:
40+
# print(",", end="")
41+
# else:
42+
print(' ',end="")
43+
for k in range(math.floor(12-2.3*i)):
44+
if (i==0 or i==3) and k==0:
45+
print('.', end="")
46+
elif i>2 and 3*i+k==13:
47+
print("*", end="")
48+
else:
49+
print(",",end="")
50+
for l in range(7-2*i):
51+
# if i<3:
52+
# print("*",end="")
53+
# else:
54+
# print("a",end="")
55+
56+
print("*", end="")
57+
for k in range(math.floor(12 - 2.3* i)):
58+
if i==1 and k==8:
59+
print(",.",end="")
60+
elif i==4:
61+
print(",.",end="")
62+
break
63+
elif i>1 and k==0:
64+
print("*", end="")
65+
else:
66+
print(",", end="")
67+
print("")

0 commit comments

Comments
 (0)