# coding:utf-8
#程序运行完成时一定要有输出语句,本工具才能正确展示运行结果。 
def quick_sort(li):
    pass


if __name__ == '__main__':
    pass
hzwpy94(null) - 2020-07-02 0 人
快速排序代码
# coding:utf-8
#程序运行完成时一定要有输出语句,本工具才能正确展示运行结果。 
text = input("input:")
weiyou(前端大神) - 2020-06-26 0 人
python-exercise
#coding=utf-8
'''
Created on 2014-11-17
 
@author: Neo
'''
import turtle
import math
 
def draw_polygon(aTurtle, size=50, n=3):
    ''' 绘制正多边形
 
    args:
        aTurtle: turtle对象实例
        size: int类型,正多边形的边长
        n: int类型,是几边形        
    '''
    for i in xrange(n):
        aTurtle.forward(size)
        aTurtle.left(360.0/n)
 
def draw_n_angle(aTurtle, size=50, num=5, color=None):
    ''' 绘制正n角形,默认为黄色
 
    args:
        aTurtle: turtle对象实例
        size: int类型,正多角形的边长
        n: int类型,是几角形    
        color: str, 图形颜色,默认不填色
    '''
    if color:
        aTurtle.begin_fill()
        aTurtle.fillcolor(color)
    for i in xrange(num):
        aTurtle.forward(size)
        aTurtle.left(360.0/num)
        aTurtle.forward(size)
        aTurtle.right(2*360.0/num)
    if color:
        aTurtle.end_fill()
 
def draw_5_angle(aTurtle=None, start_pos=(0,0), end_pos=(0,10), radius=100, color=None):
    ''' 根据起始位置、结束位置和外接圆半径画五角星
 
    args:
        aTurtle: turtle对象实例
        start_pos: int的二元tuple,要画的五角星的外接圆圆心
        end_pos: int的二元tuple,圆心指向的位置坐标点
        radius: 五角星外接圆半径
        color: str, 图形颜色,默认不填色    
    '''
    aTurtle = aTurtle or turtle.Turtle()
    size = radius * math.sin(math.pi/5)/math.sin(math.pi*2/5)
    aTurtle.left(math.degrees(math.atan2(end_pos[1]-start_pos[1], end_pos[0]-start_pos[0])))
    aTurtle.penup()
    aTurtle.goto(start_pos)
    aTurtle.fd(radius)
    aTurtle.pendown()
    aTurtle.right(math.degrees(math.pi*9/10))
    draw_n_angle(aTurtle, size, 5, color)
 
def draw_5_star_flag(times=20.0):
    ''' 绘制五星红旗
 
    args:
        times: 五星红旗的规格为30*20, times为倍数,默认大小为10倍, 即300*200
    '''
    width, height = 30*times, 20*times
    # 初始化屏幕和海龟
    window = turtle.Screen()
    aTurtle = turtle.Turtle()
    aTurtle.hideturtle()
    aTurtle.speed(10)
    # 画红旗
    aTurtle.penup()
    aTurtle.goto(-width/2, height/2)
    aTurtle.pendown()
    aTurtle.begin_fill()
    aTurtle.fillcolor('red')
    aTurtle.fd(width)
    aTurtle.right(90)
    aTurtle.fd(height)
    aTurtle.right(90)
    aTurtle.fd(width)
    aTurtle.right(90)
    aTurtle.fd(height)
    aTurtle.right(90)    
    aTurtle.end_fill()
    # 画大星星
    draw_5_angle(aTurtle, start_pos=(-10*times, 5*times), end_pos=(-10*times, 8*times), radius=3*times, color='yellow')  
    # 画四个小星星
    stars_start_pos = [(-5, 8), (-3, 6), (-3, 3), (-5, 1)]
    for pos in stars_start_pos:
        draw_5_angle(aTurtle, start_pos=(pos[0]*times, pos[1]*times), end_pos=(-10*times, 5*times), radius=1*times, color='yellow')  
    # 点击关闭窗口
    window.exitonclick()
 
if __name__ == '__main__':
    draw_5_star_flag()
steinonoobie(Toaru_Sucial()) - 2020-06-22 0 人
国旗(python)
for i in range(6):
    print(bin(i + 1).replace('0b', '').zfill(3)) 
lohiecan(程独秀) - 2020-06-14 0 人
python循环实现打印001到110
# coding:utf-8
#程序运行完成时一定要有输出语句,本工具才能正确展示运行结果。 
import json
import requests
headers = {
     "Accept": "image/wxpic,image/tpg,image/wxpic,image/tpg,image/webp,image/apng,image/*,*/*;q=0.8",
    #  'content-type': 'application/x-www-form-urlencoded', # Is set automatically
     'User-Agent': 'Mozilla/5.0 (Linux; Android 10; MI 8 Lite Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.62 XWEB/2353 MMWEBSDK/200401 Mobile Safari/537.36 MMWEBID/7655 MicroMessenger/7.0.14.1640(0x27000E35) Process/appbrand4 NetType/4G Language/zh_CN ABI/arm64 WeChat/arm64',
     "Referer": "https://servicewechat.com/wx9c3496d1bfc6a1fa/20/page-frame.html" #微信请求头
    }
datas = json.dumps({"screenName": "yangmi_"})
r = requests.get("https://vip.koudaikr.cn/api/pps?dw=https%3A%2F%2Fscontent-sin6-2.cdninstagram.com%2Fv%2Ft51.2885-15%2Fe35%2Fc0.135.1080.1080a%2Fs320x320%2F42885937_747396932289024_7708396483948017103_n.jpg%3F_nc_ht%3Dscontent-sin6-2.cdninstagram.com%26_nc_cat%3D100%26_nc_ohc%3DEaOB5ILIkJsAX-ADD2w%26oh%3D06d7e651e5428b83f589d559d8be222a%26oe%3D5F0FEBBC", data={}, headers=headers)
# print(r.text)
print(r)
# print(r.content)
2239146847qq(dengbaoling) - 2020-06-13 0 人
dsddsdssdds
#RMB汇率转换
rmb_str_value = input ('请输入RMB金额:')
rmb_Value = eval(rmb_str_value)
usd_vs_rmb = 6.77
usd_value = rmb_str_value / usd_vs_rmb
print('美元(USD)金额:',usd_value)
mirade(前端大神) - 2020-06-01 0 人
RMB汇率转换
没有了
1/14 下一页