# 初始化变量来存储总和和计数
sum_of_numbers = 0
count = 1
# 使用while循环从1加到10
while count <= 10:
sum_of_numbers += count
count += 1
# 输出结果
print("The sum of numbers from 1 to 10 is", sum_of_numbers)
阅读全部
|
lin_fan
贴于 2024年5月4日 15:35
hide
bbsi
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
'''
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