Commit 376a07d6 by BellCodeEditor

auto save

parent f20e6757
Showing with 29 additions and 5 deletions
c = [[0 for i in range(2)] for i in range(11)] #存放奇数个5和偶数个5的二维列表
c[1][0] = 9 #一位数中包含偶数个5的个数
c[1][1] = 1 #一位数中包含奇数个5的个数
k = 9
n = 4
for i in range(2,n+1):
if i == n:
k = k-1
c[i][0] = c[i-1][1] + k * c[i-1][0]
c[i][1] = k*c[i-1][1] + c[i-1][0]
print(c)
\ No newline at end of file
import math
print(math.sqrt(0.2))
\ No newline at end of file
import turtle
turtle.circle(80,-360)
turtle.circle(-80)
turtle.forward(160)
turtle.circle(80)
turtle.circle(-80)
turtle.done()
\ No newline at end of file
# 勇于挑战的创造师,请运行以下代码,看看能不能删掉水果列表中的香蕉,运行结果是什么呢? # 勇于挑战的创造师,请运行以下代码,看看能不能删掉水果列表中的香蕉,运行结果是什么呢?
list=['苹果','香蕉','西瓜','香蕉','桃子','香蕉'] list=['苹果','香蕉','西瓜','香蕉','桃子','香蕉']
for i in range(len(list)): while True:
if "香蕉" in list: try:
list.remove("香蕉") list.remove('香蕉')
print(list) except:
\ No newline at end of file break
print(list)
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