首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看Python 3
jym=[1,0,10,9,8,7,6,5,4,3,2]#校验码
a=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2]#对应系数
#b=[6,2,1,1,2,3,1,9,9,8,0,6,2,5]
b=list(input("输入身份证\n"))#输入的字符以数组格式储存
for i in range(0,len(b)):#把输入的字符转换成数字
 b[i]=int(b[i])
c=0 
for i in range(0,14):
    c=c+a[i]*b[i]
#print(c)

for i in range(0,10):
......................
阅读全部 | 曦浱 贴于 2023年10月31日 22:23     hide bbsi
import turtle as t
from datetime import*
def Skip(step):
    t.penup()
    t.forward(step)
    t.pendown()
def mkHand(name,length):
    t.reset()
    Skip(-length*0.1)
    t.begin_poly()
    t.forward(length*1.1)
    t.end_poly()
......................
阅读全部 | 小白在此 贴于 2023年8月7日 22:05     hide bbsi
import turtle
t = turtle.Turtle()

t.goto(-100,0)
t.pensize(5) #设置外花边的大小
t.color('red', 'yellow')
t.begin_fill()
for i in range(0, 20):
  t.forward(200)
  t.left(170)
t.end_fill()
t.done()
阅读全部 | 一剑破光阴 贴于 2023年6月17日 12:47     hide bbsi
for x in (1,2,3)
阅读全部 | wrx 贴于 2022年12月21日 14:54     hide bbsi
'''
def descrip_city(city_name, coury_name):
    #return(city_name + "is belong to "+ coury_name)
    city_info = {"city":city_name, "country":coury_name}
    return city_info
result = descrip_city(city_name='Reykjavik', coury_name='Iceland.')
print(result)
'''

def mname(*arg):
    # TODO: write code...
    for a in arg:
......................
阅读全部 | 感v 贴于 2022年3月29日 11:15     hide bbsi
#!/usr/bin/python3
from bottle import route,hook,template, run,request,response,get
import pymysql,json
@hook('after_request')
def enable_cors():
    response.headers['Access-Control-Allow-Origin'] = '*'
    response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, OPTIONS'
    response.headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, X-Requested-By, If-Modified-Since, X-File-Name, X-File-Type, Cache-Control, Origin'
@get('/hello')
def hello():
    db = pymysql.connect(host="172.16.8.224",user= "reader", password="123456",database= "student_information",port=1432)
    cursor = db.cursor()
......................
阅读全部 | mimijilu 贴于 2021年11月16日 12:44     hide bbsi
#!/usr/bin/python3
print('y=应用层,b=表示层,h=会话层,c=传输层,wa=网络层,s=数据链路层,wu=物理层')
print('请输入答案,以空格隔开:')
while True:
b=[-1,-1,-1,-1,-1,-1,-1]
a=input().split()
if a[0]=='exit' : break;
if a[0]=='js':
c=eval(a[1])
print (c)
continue
for i in range(0,len(a)):
......................
阅读全部 | mimijilu 贴于 2020年11月23日 12:53     hide bbsi
#!/usr/bin/env python
# -*- coding:utf-8 -*-

import turtle
import time

#  画心形圆弧
def hart_arc():
      for i in range(200):
            turtle.right(1)
            turtle.forward(2)

......................
阅读全部 | 苍凌 贴于 2020年5月2日 19:12     hide bbsi
print('hello')
阅读全部 | dairyboy 贴于 2019年9月19日 21:36     hide bbsi
python中有没有方法实现下面的代码?
就是用变量代替函数名,使用变量名也能实现函数的功能。


def test1():
    print("----1----")

local_name = test1

local_name()
阅读全部 | eakit67 贴于 2019年1月7日 22:04     hide bbsi
1 2 下一页