ls = [[] for i in range(7)] print('ls==', ls) for k in range(1, 7): # 1-9 test = [i for i in range(k)] ls[k] = test print('ls==', ls) 运行结果: ...
分类:
编程语言 时间:
2021-04-21 11:59:58
阅读次数:
0
输出小于输入值的所有正偶数。 1、while语句 #include <stdio.h> int main(void) { int i = 2, j; puts("please input an integer."); printf("j = "); scanf("%d", &j); while ( ...
分类:
编程语言 时间:
2021-04-20 15:40:50
阅读次数:
0
下午闲着无聊 用python写了个字典转MD5字典的脚本 import requestsimport hashlibdef baopo(script): print(u" 转化开始:") str=open(script).read() str_list=str.split('\n') print(s ...
分类:
编程语言 时间:
2021-04-20 15:25:35
阅读次数:
0
Mac下Core Shell 使用lrzsz命令,上传,下载文件 新增~/.bashrc_Core_Shell # Bash support for Core Shell, reference: /etc/bashrc_Apple_Terminal on macOS # Report Working ...
分类:
系统相关 时间:
2021-04-20 15:02:28
阅读次数:
0
一、词频统计: 读文本文件生成RDD lines lines=sc.textFile("file:///usr/local/spark/mycode/rdd/word.txt") lines.foreach(print) 将一行一行的文本分割成单词 words flatmap() words=lin ...
分类:
其他好文 时间:
2021-04-20 14:04:55
阅读次数:
0
「图论」第2章 最小生成树课堂过关 A. 【例题1】繁忙都市 题目 代码 prim #include <iostream> #include <cstdio> #include <cstring> using namespace std; #define N 310 #define M 200010 ...
分类:
其他好文 时间:
2021-04-19 16:02:22
阅读次数:
0
6.成绩统计(15) 对给定人数的成绩输出其及格率和优秀率(百分号前保留整数) n = int(input()) a,b=0,0 for i in range (n): s = int(input()) if s>=60: a+=1 if s>=85: b+=1 print('{:.0%}'.for ...
分类:
其他好文 时间:
2021-04-19 15:57:59
阅读次数:
0
pytorch写神经网络 (1)准备数据集 (2)涉及模型(yheight) (3)构造损失函数和优化器 (4)训练周期(前馈、反馈、更新) 1 import torch 2 3 #1.准备数据 4 x_data=torch.tensor([[1.0],[2.0],[3.0]]) 5 y_data= ...
分类:
其他好文 时间:
2021-04-19 15:52:05
阅读次数:
0
1 // 变长参数传递与两个函数之间 2 template <class... Args> 3 void myTest(Args... args) { 4 printf("%d,%d,%d,%d", args...); 5 } 6 int main() { 7 myTest(1, 2, 3, 4); ...
分类:
其他好文 时间:
2021-04-19 15:50:56
阅读次数:
0
(手写IOC容器) 相信很多朋友对Spring已经很熟悉了,面试中也经常会被问到Spring里面相关的知识,比如IOC、DI、AOP等,下面通过手写IOC的方式来对IOC里面相关的内容,进行熟悉和理解 IOC分析 IOC是什么 Inversion of Control 控制反转,也称依赖倒置(反转) ...
分类:
编程语言 时间:
2021-04-19 15:39:41
阅读次数:
0