Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson15-diy1
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
7c0188c9
authored
Dec 16, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
a075876f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
1.py
1.py
0 → 100644
View file @
7c0188c9
#1****************
# a=int(input("输入一个正整数"))
# print(a+a)
#2****************
# a=input("输入只有小写字母的字符串")
# print(a[0]+a[-1])
#3****************
# from itertools
#https://zhuanlan.zhihu.com/p/396290992
# import itertools
# a=[1,2,3,4,5]
# zs=[]
# hs=[]
# #intertools实现在列表取所有取3个数的所有不同的方法
# for i in itertools.combinations(a,3):
# print(i,end=' ')
# s=0
# for j in i:
# s+=j
# zs.append(s)
# zs=set(zs)
# print()
# print(zs)
# for i in zs:
# for j in range(2,i):
# if i%j==0:
# hs.append(i)
# break
# print(hs)
# print(len(zs))
# print(len(hs))
#4****************
# n=int(input("输入一个2-15的数字"))
# l1=[]
# for i in range(n):
# l2=[]
# for j in range(i+1):
# if j==0 or j==i:
# l2.append(1)
# else:
# l2.append(l1[i-1][j]+l1[i-1][j-1])
# l1.append(l2)
# for i in l1:
# print(i)
# for i in range(n):
# print(' '*(n-i),end='')
# for j in l1[i]:
# print(j,end=' ')
# print()
#5****************
# bijiao = []
# number = []
# n=6
# lst=[3,2,1,5,6,2]
# #先求出所有2层,然后3层,一直到6层
# for i in range(n):
# for j in range(n-i-1):
# bijiao = lst[j:j+2+i] # 事先把需要比较的数放入一个列表内
# he = min(bijiao) * (i + 2) # 对biaojiao[]的元素取一个最小值进行相乘
# number.append(he) # 把求得的数进行储存
# he = 0
# bijiao = []
# print(number)
# number.sort() # 遍历列表,取最大值
# print(number[-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