Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-4
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2a9e5d87
authored
Aug 08, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0cc37ad4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
1.py
1.py
0 → 100644
View file @
2a9e5d87
#1 2 3 4 5 6 7 8 9 10...10
#-=+ 删除 添加
# 字母去重排序
# 在一列表中产生n个大写字母,删除其中重复字母,
# 并按照A到Z顺序排列输出。同时输出删除字母个数。
# 例如输入 5 随机产生原始字母:[ "D","H","K","E","H"]
# 输出:去重后字母排序:["D","E","H","K"]
# 输出:共删除字母个数:1个。
# 请编写程序实现上述功能,或补全代码。
#- + 2
# 8
# 2 3 4 6 7 8 10 11 12 14 15
# # 需要 0 4 8 12 16
# # 实际 0 3 6 9 12
# a=list(range(1,101))
# b=[]
# while len(a)>1:
# for i in range(1,len(a),2):
# b.append(a[i])
# a=b
# b=[]
# print(a)
# a=input('shuru')
# b=a.split(' ')
# c=[]
# for i in b:
# c.append(int(i))
# def b(e):
# return e%2==1
# a=list(filter(b,list(map(int,input("输入数字").split(' ')))))
# print(a)
#增删改查
a
=
[
1
,
2
,
3
,
4
]
#列表名[索引]
# for i in range(4): #[0,1,2,3]
# print(a[i])
# for i in a:
# print(i)
i
=
0
while
i
<
len
(
a
):
print
(
a
[
i
])
i
=
i
+
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment