码迷,mamicode.com
首页 >  
搜索关键字:rand 随机数 标准库    ( 12545个结果
关于python随机数random
import random 1.random.randint 上下边界都包含,随机整数,可能会重复 a = ['python', 'java', 'php', 'c++']# print(a[random.randint(0, len(a) - 1)]) 2.random.random 随机小数,0 ...
分类:编程语言   时间:2021-01-18 11:04:03    阅读次数:0
04.循环结构
1、while循环: ''' 猜字游戏 ''' import random number = random.randint(1,101) jishu = 0 while 1: num = int(input('请输入一个数字:')) if num > number: print('小一点') eli ...
分类:其他好文   时间:2021-01-16 11:55:22    阅读次数:0
爬虫-urllib模块的使用
urllib是Python中请求url连接的官方标准库,在Python3中将Python2中的urllib和urllib2整合成了urllib。urllib中一共有四个模块,分别如下: request:主要负责构造和发起网络请求,定义了适用于在各种复杂情况下打开 URL (主要为 HTTP) 的函数 ...
分类:Web程序   时间:2021-01-15 11:56:28    阅读次数:0
线程通信-全局变量-标准库threading
from threading import Thread from time import sleep a = 1 def foo(): global a a = 1000 def bar(): sleep(1) print("a = ",a) t1 = Thread(target = foo) t ...
分类:编程语言   时间:2021-01-13 10:50:50    阅读次数:0
C#生成一组连续的十六进制地址字符串
首先随机地生成一个十六进制串,就用字符串构造一个吧。 随机数用Random.Next();生成,不过需要注意的是,这个函数用当前始终作为随机种子,无论循环执行多少次函数GetRandomAddress()得到的都是相同的结果。 private char[] RandomSet = { '0', '1 ...
分类:Windows程序   时间:2021-01-11 11:24:37    阅读次数:0
ssh私钥登录
生成ssh公钥认证所需的公钥和私钥文件 [jiaqi.li@localhost ~]$ ssh-keygen -t rsa -b 4096Generating public/private rsa key pair.Enter file in which to save the key (/home ...
分类:其他好文   时间:2021-01-11 11:08:35    阅读次数:0
Java 基础(获取随机数, switch-case 结构)
获取一个整型随机数: 10-99 公式: [a,b] → (int)(Math.random() * (b - a + 1) +a) class RandomInt { public static void main(String[] args){ int value = (int)(Math.ra ...
分类:编程语言   时间:2021-01-07 11:59:44    阅读次数:0
Python for Data Science - Creating standard data graphics
Chapter 4 - Practical Data Visualization Segment 1 - Creating standard data graphics import numpy as np from numpy.random import randn import pandas a ...
分类:编程语言   时间:2021-01-06 12:27:05    阅读次数:0
使用Tensorflow.keras创建简单模型
训练代码: import tensorflow as tf from tensorflow import keras import numpy as np from matplotlib import pyplot as plt np.random.seed(42) # 设置numpy随机数种子 t ...
分类:其他好文   时间:2021-01-06 12:16:12    阅读次数:0
数据库的查询
1.构造数据 为了操作方便, 先构造以下数据 1.1 学生表 create table `student` ( `id` int unsigned primary key auto_increment, `name` char(32) not null unique, `sex` enum('男', ...
分类:数据库   时间:2021-01-06 12:13:37    阅读次数:0
12545条   上一页 1 ... 12 13 14 15 16 ... 1255 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!