【电子学会】2021年09月Python二级 -- 编程题36

Python二级题目解析

1、题目

日期转换

编写一个程序,实现用户输入一个日期,格式为"月/日/年",如输入’05/21/2021’,程序输出日期为’May 21,2021’。

1至12月的英文名称如下:

January,February,March,April,May,June,July,August,September,October,November,December。


2、答案

参考答案:

说明:程序仅供参考,考生可以有多种解决方法。

date = input('输入一个日期(月/日/年):')
month, day, year = tuple</
python日期转换 青少年编程电子学会python编程等级考试二级真题解析2021年9月 目录python日期转换 2021年9月 python编程等级考试二级编程题 一、题目要求1、编程实现2、输入输出3、评分标准二、解题思路1、案例分析2、流程分析三、程序代码四、运行结果五、考点分析 编写一个程序,实现用户输入一个日期,格式为:月/日/年,如输入 05/22/2022,... 阅读详情

相关推荐

2022年3月电子学会Python等级考试试卷(二级)答案解析

目录 青少年软件编程(Python)等级考试试卷(二级) 分数:100题数:37 一、单选题(共25题,每题2分,共50分) 1. 关于Python中的列表,下列描述错误的是?( ) 2. 已知列表a=[1,3,5,7],下列语句无法将a变成a=[1,3,5,7,9]的是?( ) 3. 关于以下代码段的说法错误的是?( ) 4. 下面程序的运行结果是?( ) 5. 以下关于元组的描述正确的是?( ) 6. 以下程序的输出结果是?( ) 7. 以下代码的输出结果是?( ) 8. 以下..

IT_Scratch的博客 8045

2021年09月 Python(二级)真题解析#中国电子学会#全国青少年软件编程等级考试

根据给定的列表 alist=[‘cat’,‘bat’,‘cat’,‘hat’,‘cat’],执行 alist.remove(‘cat’) 后,会移除第一个出现的 ‘cat’ 元素。元组是不可变的,一旦创建后,其中的元素不可修改。给定的字典 dic 包含以下键值对:1: 2,‘3’: ‘d’,‘sex’: 1 和 4: {‘No’: 1, ‘name’: ‘Mike’}。对于字典dic={1:2,‘3’:‘d’,‘sex’:1,4:{‘No’:1,‘name’:‘Mike’}},len(dic)的值是?

人生就是一个不断学习的过程 3974

【电子学会】2021年09月Python一级 -- 编程题36

计算题:龟兔赛跑,兔子刚开始跑得非常快,但是兔子太骄傲了,在领先乌龟100米时,自行休息睡着了,乌龟一步一步进行追赶,乌龟的速度是 V m/s(V < 10),请计算出乌龟多长时间就可以追上兔子呢?要求:(1)程序开始运行时,询问请输入乌龟爬行的速度,输入一个数字;(2)程序根据输入的数字计算出乌龟需要多长时间就可以追上兔子;(3)输出的格式为:“乌龟能够追上兔子所需的时间是:*秒。

老马的程序人生 832

2021年12月电子学会Python等级考试试卷(三级)答案解析

需要所有考级相关的资料可以添加我的微信:15570666506 青少年软件编程(Python)等级考试试卷(三级) 分数:100题数:38 总体情况 一、单选题(共25题,共50分) 1. 小明在学习计算机时,学习到了一个十六进制数101,这个十六进制数对应的十进制数的数值是?( ) A. 65 B. 66 C. 256 D. 257 试题编号:20200313-tsn-04 试题类型:单选题 标准答案:D 试题难度:容易 ...

IT_Scratch的博客 2万+

【电子学会】2020年09月Python二级 -- 编程题36

提示用户输入两个正整数,编程求出介于这两个数之间的所有质数并打印输出。显示格式为“*数是质数。注:质数(Prime number),又称素数,指在大于1的自然数中,除了1和该数自身外,无法被其它自然数整除的数。

老马的程序人生 1158

python密码判断 2023年12月青少年编程电子学会python编程等级考试二级真题解析

python密码判断 2023年12月 python编程等级考试级编程题 一、题目要求 1、编程实现 密码判断:编写一段能够实现密码判断功能的代码 程序运行开始后,用户通过键盘输入密码(格式为字符串); 如果密码错误,让用户继续输入密码 如果密码正确,屏幕输出"密码正确,欢迎您!”,并终止循环,结束程序 正确的密码可以在程序中明确,无需用户输入。 2、输入输出 输入描述:输入密码(格式为字符串) 输出描述:输出“密码正确,欢迎您!”

青少年编程学习指导 1369

【电子学会】2021年09月Python三级 -- 编程题36

输入10个数据进行升序排序,并在这有序数据上插入一个数据,使之仍然有序。程序代码如下,请补全。

老马的程序人生 617

【电子学会】2020年06月Python二级 -- 编程题36

数字转汉字要求:用户输入一个1~9(包含1和9)之间的任一数字,程序输出对应的汉字。如输入2,程序输出“二”。可重复查询。

老马的程序人生 771

【电子学会】2022年12月Python二级试卷

如果输入的字符串的长度是奇数,就输出字符串最中间的字符。27、Python中,可以通过索引来访问列表、字符串等序列,也可以通过索引对列表中的元素和字符串中的字符进行修改。1、分别取出该字符串的第偶数位的元素(提醒注意:是按照从左往右数的方式确定字符串的位置);(6)当用户输入的字符串长度为偶数时,能正确地截取字符串的最后一个字符并输出;(5)当用户输入的字符串长度为奇数时,能正确地截取字符串最中间的字符并输出;26、字典的元素可以通过键来访问,也可以通过索引(下标)来访问。

老马的程序人生 999

【电子学会】2021年03月Python一级 -- 编程题36

绘制如下图形 ,一个正方形,内有三个红点,中间红点在正方形中心。要求如下:(1)正方形边长为200,线条为黑色;(2)圆点的直径均为20 ,填充颜色为红色,画完后隐藏画笔;(3)中间圆点的圆心位置为画布正中心,三个圆心之间距离相隔为40。

老马的程序人生 949

2021年6月电子学会Python等级考试试卷(三级)考题解析

青少年软件编程(Python)等级考试试卷(三级) 分数:100.00 题数:38 一、单选题(共25题,每题2分,共50分) 1. 关于open()函数的参数,下列描述正确的是?( ) A、"w+" 以十六进制格式打开一个文件只用于写入 B、"r+"打开一个文件用于读写。文件指针将会放在文件的末尾 C、"w" 打开一个文件只用于写入。如果该文件已存在则打开文件,并从原有位置开始编辑,即保留原有内容。如果该文件不存在,创建新文件 D、"r" 以只读方式打开文件,文...

IT_Scratch的博客 3万+

【电子学会】2021年12月Python二级 -- 编程题36

日期计算器设计一款日期计算程序,能够实现下面的功能:(1)要求用户分别输入年、月、日(分三次输入);(2)程序自动会根据输入的年月日计算出这一天是这一年的第几天;(3)输出格式为:这是****年的第**天;请输入某年某月某日,通过编程判断这一天是这一年的第几天。友情提示:考试平台暂不支持eval()命令。

老马的程序人生 1068

2022年9月电子学会青少年编程Python等级考试一级真题解析(Python一级)

2022年9月电子学会青少年编程Python等级考试一级真题解析(Python一级),判断题和编程题

自在逍遥 1190

【电子学会】2022年09月Python一级 -- 编程题36

每个人都知道自己的鞋码,但是不知道自己的脚长,请写一个程序,帮助大家利用鞋码算出脚长。要求:1、允许用户输入自己的鞋码,并有提示语 ‘请输入你的鞋码:’,不需要包括单引号;2、计算鞋码,脚长 = (鞋码 + 10) / 2;3、输出脚长,并有提示语 ‘你的脚长是(单位:厘米):’,不需要包括单引号。

老马的程序人生 1983

OpenCV函数用法之calibrateCamera

参考链接:opencv中标定函数calibrateCamera_ychl87的专栏-优快云博客 世界坐标系的三维点投影到成像坐标系中的二维点的投影公式如下: 其中(X,Y,Z)为世界坐标系中的三维点; (u,v)为成像面坐标系中的二维点; A为相机的内参数矩阵:(cx,cy)为主光轴点,一般为图像的中心;fx和fy为焦距; [R|t]为相机的外参数矩阵:R为旋转矩阵,t为位移矩阵; 上述公式的简单推理过程如下 考虑到镜头畸变 其中,k1,k2,k3,k4,k5和k6为径向畸变,p1和.

tiger&sheep的博客 3万+

波分复用-Zblock仿真

Z-BLOCK是一种用于光通信模块的光学元件,其核心结构是在玻璃块一侧贴有4个特定波长滤光片,另一侧镀有反射膜和增透膜。光信号在内部呈现Z字形反射路径,实现波长分离。文章以可见光LED为例,在ZEMAX中演示了非序列模式下的建模过程,重点介绍了滤光片和膜层的参数设置方法。需要注意的是,入射角度需根据玻璃折射率、通道高度和厚度精确计算,否则可能导致光泄漏。该建模方法同样适用于光通信中的光纤激光器系统。

Zhaxibamao的博客 1743

SD - WAN:企业出海的网络加速器

例如,一家中国的跨境电商企业,在欧美市场的促销活动期间,借助 SD - WAN 技术,即使面对海量订单数据的交互,也能确保欧美客户在浏览商品、下单支付时感受到近乎本地网络的流畅体验,大大提升了客户满意度,稳住了销售增速。企业无需在海外本地部署大量冗余服务器,只需依托云台,借助 SD - WAN 快速稳定的网络连接,即可轻松实现业务拓展,进一步精简运营架构,提升整体效能。在未来,随着技术的不断演进和企业出海需求的持续增长,SD - WAN 将持续赋能,助力更多企业在全球市场扬帆远航,书写辉煌篇章。

idcicp_com的博客 446

FPGA实践教程: 使用HLS将C程序生成IP核心进行FPGA开发

请根据您使用的FPGA开发板和供应商选择适当的HLS工具,并按照他们的安装指南进行安装。根据您使用的FPGA开发板和供应商选择适当的HLS工具,并按照他们的安装指南进行安装。通过本教程,您了解了如何使用HLS工具将C程序生成IP核心,并将其用于FPGA开发。在HLS项目中,您可以对C程序进行设计和优化,以生成对应的IP核心。在HLS项目中,您可以对C程序进行设计和优化,以生成相应的IP核心。将导出的IP核心导入到FPGA项目中。使用FPGA开发环境的菜单中的"导入"或"添加文件"选项导入IP核心。

CqpFsharp的博客 454

YOLOv5源码逐行超详细注释与解读(2)——推理部分detect.py

全网最详细的YOLOv5之推理部分detect.py源码逐行注释,近四万字的超详细讲解!小白入门必看!

路人贾的博客 5万+

C++高级数据结构算法 | 二叉树的四种遍历算法详解(递归与非递归实现)

二叉树遍历方法 、前序遍历算法 、中序遍历算法 、后序遍历算法 、层序遍历算法

ZY-JIMMY 2563

131、高通骁龙影像平台总览:Spectra ISP 各代架构演进与特性对比

摘要:本文深入分析了高通骁龙Spectra ISP从250到780代的架构演进与技术痛点,揭示了各代关键改进与隐藏问题。重点剖析了双ISP带宽分配、AI ISP黑盒决策、温度控制等实战问题,并给出具体解决方案(如寄存器配置、QoS调整等)。文章强调工程师需平衡带宽、功耗与画质的三角关系,建议调试时先关闭AI模块建立基线,关注统计引擎配置,并建立温度监控机制。最后指出理解架构局限比追求完美设计更重要,需要针对不同场景找到合适的妥协方案。(148字)

sundong_81的博客 207

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

上一篇: 【电子学会】2021年09月Python二级 -- 编程题 37
下一篇: 【电子学会】2021年12月Python二级 -- 编程题36
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

青少年编程小助手_Python

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值