Commit b78a8c93 by BellCodeEditor

auto save

parent dc22b1a3
# with open(r'C:\Users\Administrator\Desktop\r.txt','r',encoding='utf-8') as a:
# b=a.read()
# c=0
# for i in b:
# if i=='d':
# c+=1
# print(c)
a=int(input("输入一个数:"))
b=int(input("输入一个比前者大的数:"))
for i in range(a,b+1):
for q in range(2,i):
if i%q==0:
break
else:
print(i,"是质数")
print("regegtyetueds:%05.5f"%3.876)
\ No newline at end of file
import turtle
turtle.penup()
turtle.goto(-200,150)
turtle.pendown()
turtle.fillcolor("red")
turtle.begin_fill()
turtle.forward(400)
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.forward(300)
turtle.end_fill()
turtle.penup()
turtle.goto(-80,30)
turtle.pendown()
turtle.fillcolor("yellow")
turtle.begin_fill()
turtle.right(90)
turtle.pencolor("yellow")
for i in range(5):
turtle.forward(150)
turtle.right(144)
turtle.end_fill()
turtle.hideturtle()
turtle.done()
\ No newline at end of file
# with open(r'C:\Users\Administrator\Desktop\tt.txt','w',encoding='utf-8')as a:
# a.write("额度色发发发")
with open(r'C:\Users\Administrator\Desktop\tt.txt','r',encoding='utf-8')as a:
b=a.read()
if "色" in b:
t=b.replace('色','过')
with open(r'C:\Users\Administrator\Desktop\tt.txt','w',encoding='utf-8')as a:
a.write(t)
a=input().split(',')
b=input('查找的字符串')
c=[]
d=0
for i in range(len(a)):
if b == a[i]:
d=d+1
c.append(b)
for q in c:
if q in a:
a.remove(q)
print(a)
print(d)
\ No newline at end of file
#求圆的周长=flo,直径和面积
aat(input("输入半径:"))
pai=3.1415
print("圆的直径:%.2f"%(2*a),"圆的周长:%.2f"%(2*pai*a),"圆的面积:%.2f"%(pai*a*a))
\ No newline at end of file
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