Commit 56e1a307 by BellCodeEditor

save project

parent 313964cb
File added
input_d=int(input("长:")) input_d=int(input())
input_h=int(input("高:")) input_h=int(input("高:"))
print"面积是",input_d*input_h/2 print("面积是", (input_d*input_h)/2
\ No newline at end of file \ No newline at end of file
# 创建一个有7个整数的整数列表
list2 = [33,21,30,11,42,23,23] list2 = [33,21,30,11,42,23,23]
# 返回最小值 # 将列表从小到大排序
print (list2.index(max(c)) ) list2.sort()
\ No newline at end of file # 将已经从小到大排序的列表进行逆序排列
list2.reverse()
# 找出列表首位数字(即最大值)并乘以4
x = list2[0]*4
# 输出运算结果
print(x)
\ No newline at end of file
# 初始化三角形的三个边长
a=6
b=8
c=10
# 乘法运算三角形面积
s = a*b/2
# 输出三角形面积
print(s)
\ No newline at end of file
# 创建整数列表
list1 = [1,2,3,1,2,1,4,6,3]
# 用for循环剔除列表里的数字1
for i in list1:
if i ==1:
list1.remove(1)
# 用for循环剔除列表里的数字2
for i in list1:
if i ==2:
list1.remove(2)
# 用for循环剔除列表里的数字3
for i in list1:
if i ==3:
list1.remove(3)
# 输出剔除相同数字后的最终列表
print(list1)
# 创建字符串列表1
str1 = "asdfghjkl"
# 将列表1拆分成列表2和3
str2 = "asdfgh"
str3 = "jkl"
# 截取字符串2和3,并输出
print(str2[1::2]+str3[0::2])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment