Skip to content

Commit 918f162

Browse files
author
sslinux
committed
comny
1 parent 429a4c8 commit 918f162

File tree

6 files changed

+55
-0
lines changed

6 files changed

+55
-0
lines changed

comyn_lesson/guess_number.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env python
2+
3+
4+
NUM = 35
5+
6+
count = 0
7+
8+
while count < 3:
9+
user_input = int(input("plz input a number:"))
10+
if user_input == NUM:
11+
print("you win")
12+
elif user_input < NUM:
13+
print("less")
14+
else:
15+
print("big")
16+
count += 1
17+
else:
18+
print("you lose")
19+
20+
21+
for _ in range(0,3):
22+
user_input = int(input("plz input a number:"))
23+
if user_input == NUM:
24+
print("you win")
25+
elif user_input < NUM:
26+
print("less")
27+
else:
28+
print("big")
29+
count += 1
30+
else:
31+
print("you lose")
32+

comyn_lesson/list.png

44.9 KB
Loading

comyn_lesson/print_sushu.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# 打印素数:
3+
for n in range(2,101):
4+
for x in range(2,n):
5+
if n % x == 0:
6+
break
7+
else:
8+
print(n)
9+
10+
11+
12+

comyn_lesson/slice.png

35.2 KB
Loading

comyn_lesson/tuple.png

19.1 KB
Loading

comyn_lesson/内置数据结构.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# 内置数据结构
2+
3+
内置数据结构:
4+
## list
5+
## tuple
6+
## string
7+
上述三种是线性结构,可以对其执行切片操作,解包/封包
8+
9+
## set
10+
## dict
11+
# 所有结构都可以进行解析式

0 commit comments

Comments
 (0)