自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 DOM对象方法---removeChild(),insertBefore()

一些DOM对象方法:removeChild(),insertBefore()

2022-07-23 18:58:07 437 1

原创 JavaScript定义注册页面---使用字符串对象验证注册页面

JavaScript定义注册页面---使用字符串对象验证注册页面

2022-07-19 20:57:49 1101

原创 JavaScript混入式继承方式

混入继承: 一个子类继承多个父类,简而言之就是遍历父对象成员,添加给父对象。* 特点:单对象继承举个栗子🌰

2022-07-13 21:58:19 492

原创 Python编程实践:类和对象 问题:鹦鹉学舌,定义类 Bage(八哥),使之能随机复述听过的话。

import randomclass Bage: def __init__(self): self.sentences = [] def hear(self,a): self.sentences.append(a) def repeat(self): start=0 end=len(self.sentences) if end: i=random.ran...

2022-04-17 21:09:33 1066

原创 Python编程实践 turtle实例 美国队长盾牌

import turtle as tt.penup()t.goto(0,-200)t.pendown()t.color("red")t.begin_fill()t.circle(200),t.end_fill()t.penup()t.goto(0,-150)t.pendown()t.color("white")t.begin_fill()t.circle(150)t.end_fill()t.penup()t.goto(0,-100)t.pendown()t.co.

2022-04-13 23:13:01 1688

原创 Python编程实践之计算列表 stu 中每个学生的平均分,并添加到数据末尾

fo=open("stu.txt","r+")data=[]while True: words=fo.readline() if words=='':break if words.endswith('\n'): words=words[:-1] data.append(words.split(',')for i in range(len(data)): for j in range(len(data[i])): ...

2022-04-12 22:09:18 1452

原创 Python编程实践之谢尔宾斯基三角形

def mysqrt(x,a,b): if b-a<0.0000001: return b m=(a+b)/2 if m*m>x: return mysqrt(x,a,m) else: return mysqrt(x,m,b)print(mysqrt(2,1,2))import math,turtle as tdef trangle(len): for i in range(3): t.fd(le...

2022-04-10 21:38:10 1030

原创 Python编程实践:字典逆向查找(reverse lookup),根据值 value 从字典中查找并返回其 key。●示例:lookup({‘a‘:4, ‘b‘:5, ‘c‘:6}, 4),返回 ‘

def lookup(get_value): look = {'a':4, 'b':5, 'c':4} if get_value in look.values(): return(list(look.keys())[list(look.values()).index(get_value)]) else: return noneres=lookup(4)print(res)解析:look.keys就是取出字典lookup所...

2022-04-08 23:54:38 1324

原创 编写一个函数mysum,以整数列表为参数,返回所以元素之和。

def mysum(List): sum=0 for item in List: sum+=item return sumList=[1,2,3]res=mysum(List)print(res)

2022-04-01 21:41:41 2777

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除