Giter Club home page Giter Club logo

python's People

Stargazers

 avatar

Watchers

 avatar

python's Issues

绘制五角红星

#DrawStar.py
from turtle import*
color ('red','red')
begin_fill()
for i in range (5):
          fd (200)
          rt(144)
end_fill()
done ()

CaesarChineseEncode4.py

#CaesarChineseEncode.py
ptxt=input("请输入明文文本:")
for p in ptxt:
if"a"<=p<="z":
print(chr(ord("a")+(ord(p)-ord("a")-3)%26),end='')
elif"A"<=p<="Z":
print(chr(ord("A")+(ord(p)-ord("A")-3)%26),end='')
elif 0x4E00<=ord(p)<= 0x9FA5: #中文字符加密处理
print(chr(ord(p)+3),end='')
else:
print(p,end='')

判断输入整数是否在[0,100]之间

#判断输入整数是否在[0,100]之间
num = eval (input ("请输入一个整数:"))
if num > 100 or num <0:   #判断[0,100]
    print ("输入整数小于0或大于100")
else:
    print ("输入整数在0到100之间(含)")

圆面积的计算

#CalCircleArea.py
r=25        #圆的半径是25
area=3.1415*r*r
print(area)
print("{:.2f}".format(area))   #只输出两位小数 

绘制七彩圆

import turtle
#DrawSevenColorfulCircles.py
import turtle
colors=['red','orange','golden','green','']

程序运行计时

#CalRunTime.py
import time
limit =10*1000*1000
start=time.perf_counter()
while True:
           limit-=1
           if limit <=0:
               break
delta=time.perf_counter() - star
print ("程序运行时间是:{}秒".format(delta))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.