项目地址: github.com/brython-dev/brython 当前版本 3.9.1 ,支持cpython3.9.0 cdn加速: https://www.bootcdn.cn/brython/ django中使用cpython : django-brython 最新版本发布于2020年1 ...
分类:
编程语言 时间:
2021-04-06 14:04:12
阅读次数:
0
s = set('hello,word') print(s) #set 方法 s = {'xiaoming', 'xiaoming', 'xiaoming1'} print(s) s.add('s') # 添加元素 s.clear(s) # 清空集合 s1 = s.copy(s) # 复制集合 s. ...
分类:
编程语言 时间:
2021-04-05 12:51:32
阅读次数:
0
# %s 全能 print('I am %s my hobby is %s' %('A','alex')) print('I am %s , I`m %s year old' %('A',1)) # %d 整型 # name = input('你的姓名:') # age = int(input('你 ...
分类:
编程语言 时间:
2021-04-05 12:51:05
阅读次数:
0
一 for循环 #for循环可以循环任何序列的项目 for i in range(1,10): for j in range(1,i+1): print('%s*%s=%s'%(i,j,i*j),end="") print() 二 可变不可变类型 #for循环可以循环任何序列的项目 for i in ...
分类:
编程语言 时间:
2021-04-05 12:49:56
阅读次数:
0
极坐标 import numpy as np import matplotlib.pylab as plt N = 20 theta = np.linspace(0.0,2*np.pi,N,endpoint=False) #使用linspace间隔均匀分出组距,这里从0到2pi分成N份 radii ...
分类:
其他好文 时间:
2021-04-05 12:45:25
阅读次数:
0
创建队列 #创建队列 queue=deque() #这里创建的是双端的 添加元素 #append()方法 O(1) queue.append(1) queue.append(2) queue.append(3) print(queue) #[1,2,3] 获取即将出队的元素 # O(1) temp1 ...
分类:
编程语言 时间:
2021-04-05 12:30:54
阅读次数:
0
一、kmeans聚类 import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import re pd.set_option('max_columns', 600) pd ...
分类:
其他好文 时间:
2021-04-05 12:19:16
阅读次数:
0
Python基础语法2 基本数据类型 Python 中的变量不需要声明。每个变量在使用前都必须赋值,变量赋值以后该变量才会被创建。在 Python 中,变量就是变量,它没有类型,我们所说的"类型"是变量所指的内存中对象的类型。 int1 = 1 float2 = 2.0 string = "seve ...
分类:
编程语言 时间:
2021-04-05 12:17:48
阅读次数:
0
import numpy as np import matplotlib import matplotlib.pyplot as plt matplotlib.rcParams['mathtext.fontset']='stix' plt.xlim(0, 5.5) plt.ylim(-5, 100) ...
分类:
其他好文 时间:
2021-04-05 12:14:03
阅读次数:
0
基础习题 习题1 请用代码验证'name'是否在字典的键中 info = {'name': '王刚蛋', 'hobby': '铁锤', 'age': '18'} info = {'name': '王刚蛋', 'hobby': '铁锤', 'age': '18'} if info.get('name' ...
分类:
编程语言 时间:
2021-04-05 12:13:50
阅读次数:
0