python(day005——基础知识5)

python编程实例题目 1.合并两个列表并去重 方法一: L1 = [1, 2, 3, 4] L2 = [2, 3, 4, 5, 6] L3 = L1 + L2 print(set(L3)) 方法二: L1 = [1, 2, 3, 4] L2 = [2, 3, 4, 5, 6] L3 = L1 + L2 L4 = [] for i in L3: if i not in L4: L4.append(i) print(L4) 2.输出1-100之间的偶数 L1 = [] for i 阅读详情

练习题:

1.统计输入的字符多少个

s=input("请输入一个字符串:")
result=0
for i in s:
    result+=1

print("输入内容是%s,一共有%s个字符" %(s,result))

2.统计输入的字符多少字母和数字

#方法一:
s=input("请输入一个字符串:")
result_num=0
result_str=0
for i in s:
    if (i>="a" and i<="z") or (i>="A" and i<="Z"):
        result_str+=1
    elif i>="0" and i<="9":
        result_num+=1

print("输入内容是%s,一共有数字%s个" %(s,result_num))

print("输入内容是%s,一共有字母%s个" %(s,result_str))


#方法二:引入string包
import string
s=input("请输入一个字符串:")
result_num=0
result_str=0
for i in s:
    if i in string.ascii_letters:
        result_str+=1
    elif i in string.digits:
        result_num+=1

print("输入内容是%s,一共有数字%s个" %(s,result_num))

print("输入内容是%s,一共有字母%s个" %(s,result_str))

3.将字符串重点数字去掉,只保留字母

import string
s=input("输入一个字符串:")
result=[]
for i in list(s):
    if i in string.digits:
        pass
    elif i in string.ascii_letters:
        result.append(i)

print ("改字符串删除数字后结果为"+''.join(result))

4.输入3个学生成绩,求和、平均数和最好成绩

scores=[]
for i in range(3):
    s_score=input("请输入第%s个学生成绩:" %(i+1))
    scores.append(int(s_score))
print(scores)

score_sum=0
for i in scores:
    score_sum+=i
average_score=round(score_sum/3,3)  #用round方法保留小数
max_score=max(scores)

print("成绩总和:%s,平均分数:%s,最大成绩:%s" %(score_sum,average_score,max_score))

5.输入一个学生成绩,判断优良中和不及格

score= input("请输入学生成绩:")
if int(score)>=90:
    print("优")
elif int(score)>=80:
    print("良")
elif int(score)>=70:
    print("中")
elif int(score)>=60:
    print("及格")
else:
    print("不及格")

6.生成3个随机字母的字符串,生成一个随机小数的字符串(两个整数位和两个小数位)

import random
import string
#方法一:
a=[]
flag=list(string.ascii_letters)
for i in range(3):
    a.append(random.choice(flag))
print("".join(a))

#方法二:
b=""
for i in range(3):
    b+=chr(random.randint(97,122))
print ("随机生成三个字母:",b)

#生成数字
num=round(random.randint(10,99)+random.random(),2)
print("随机生成数字:",str(num))

7.随机从1-5,和8-11取一个数

#随机从1-5,和8-11取一个数
import random
a=[]
for i in range(1,6):
    a.append(i)
for i in range(8,12):
    a.append(i)
print (a)
num=random.choice(a)
print (int(num))

c=random.choice([i for i in range(1,6)]+[i for i in range(8,12)])

print (int(c))

d=[i for i in range(11,15)]
print (d)

8.统计一个数字中包含技术数字的个数

num=12849282
num=str(num)
r=[]
for i in num:
    if int(i)%2==1:
        r.append(i)

print ("一共有奇数个数为:%s" %len(r))

9.将数字的每一位+2,转换成一个新的数字(整数和小数)

a='12324.63'
a=str(a)
result=""
#不能实现进位
for i in a:
    if i !=".":
        result += str(int(i) + 2)[:1]
    else:
        result +="."
print(float(result))

10.将每个小写字母转换为大写字母,大写字母转换为小写字母

import string
s=input("请输入大小写字母:")
r=[]
for i in s:
    if i in string.ascii_lowercase:
        r+=str.upper(i)
    else:
        r+=str.lower(i)
print("".join(r))


import string
s=input("请输入大小写字母:")
r=[]
for i in s:
    if "z">=i>="a" :
        r+=chr(ord(i)-32)
    else:
        r += chr(ord(i) + 32)
print("".join(r))

11.将一个bytes类型的gbk字符串,转为utf-8编码的bytes字符串

s="你好" #unicode
s=s.encode("gbk")
s=s.decode("gbk").encode("utf-8")

 

用 CL_SALV_TREE 把层级数据做成一棵会呼吸的 ABAP ALV 树:从类继承扫描到事件交互的完整拆解 本文介绍了SAP ABAP中使用CL_SALV_TREE实现树形ALV报表的方法。该技术将层级数据(如类继承关系)以可展开/折叠的树形结构展示,解决了传统ALV Grid无法直观显示层次结构的问题。核心实现采用"数据表+层级表"分离的设计模式:数据表存储节点业务信息,层级表维护父子关系。通过add_node方法动态构建树形结构,支持设置节点文本、图标和事件。文中提供了完整示例代码,演示了如何递归扫描ABAP类继承关系并构建树形ALV,这种技术特别适用于展示类族谱、权限树等层级数据,能显著 阅读详情

相关推荐

VS2017中调用gdal(C#版)的方法二(含gdal下载地址,配置过程,代码测试,超详细!!)

VS2017中gdal(C#)版的配置与测试 上次记录了直接在VS2017中下载并应用gdal的方法,这次来记录一下网上下载的安装包配置与测试的方法。 一、环境、版本及下载地址 win10,vs2017社区版,gdal2.4.4 还是像之前在Unity中应用gdal一样,最好是下载已经编译好的C#版的gdal,不然自己配置真的很容易出错,我就是这样的,下面提供不同版本的gdal下载地址: 1.GDAL2.4.4(C#版、64位): https://download.youkuaiyun.com/download/che

chengbaola的博客 1365

猜数字游戏_Qt

这个小栗子很多人都写过,写它仅仅是为了熟悉一些控件的使用,既不高大上也没其他想法。 1、界面构建,进入界面和操作界面。 界面简单说明: 1、主界面,显示猜数字游戏、时间、确定和退出。 2、采用stackedWidget控件,我使用的是qt5.2默认两个,但需要四个界面,选择“stackedwidget”,右击“insert page", 点击"after current page"。具体布

Irwin博客 2534

Leaflet 加载天地图完整配置指南:从插件修改到无限缩放(附源码)

本文详细介绍了Leaflet与天地图深度集成的完整配置指南,包括插件修改、无限缩放实现及源码示例。通过解析天地图服务的WMTS协议、双投影支持和密钥机制,帮助开发者突破缩放级别限制,优化地图应用性能,适用于Web地图开发和高精度GIS系统。

weixin_27180827的博客 441

python | 你知道for...in是底层原理是什么样的么?探寻python迭代器

什么是python迭代器呢?print(i)print(i)print(i)这就是python迭代器,好了,讲完了,手工。是的,使用for...in的方式,底层都是使用的是迭代器,你是不是之前写的时候,从来没有好奇过,为什么遍历不同的数据类型,都可以使用for...in通用呢?弟弟我也是一样的,没有想过,为什么可以这样写。迭代器语法我们已经讲了,接下来,我们来剥开迭代器的面纱吧。本篇文章,我们首先介绍了什么迭代器,什么是迭代器呢?最简单的for...in。

weixin_68789096的博客 517

Conda报错急救指南:遇到Malformed version string ‘~‘怎么办?(附最新解决方案)

本文深度解析Conda报错`Malformed version string '~'`的根源与解决方案。该错误通常由版本字符串解析异常或Conda版本过旧引起。文章提供了从清理缓存、针对性升级到环境重建的完整修复流程,并强调了升级Conda至最新版本是解决此类`CondaValueError`问题的根本方法,帮助开发者高效恢复工作环境。

weixin_28835789的博客 649

LED单元板驱动(HUB75接口)

开始之前先吐槽一下,搜这个的资料。要么都是Arduino,要么单片机的收费。小小的一个LED单元板,凭什么? 用Arduino是你速度快还是我ST,树莓派不好用?收费更离谱,这点东西还藏私?给你个中指凸。把原理都写出来看你怎么收费。 一、接口定义及原理 如图,有两个RGB通道,共占用6个IO。剩下的ABCDE为地址通道,LAT为行数据锁存通道,CLK为数据时钟,OE为低电平使能LED显示。图片这里没有E,证明它是16扫的,有E就会把B上面的地改为E。这样就是5位,2的5次方32扫。1.

a3748622的博客 3万+

python - for i in list 如果列表变动的话

l1=list(range(10)) for i in range(len(l1)): l1.pop() print(i,l1,l1[-1]) # 0 [0, 1, 2, 3, 4, 5, 6, 7, 8] 8 1 [0, 1, 2, 3, 4, 5, 6, 7] 7 2 [0, 1, 2, 3, 4, 5, 6] 6 3 [0, 1, 2, 3, 4, 5] 5 4 [0, 1, 2, 3, 4] 4 5 [0, 1, 2, 3] 3 6 [0, 1, 2] 2 7 [0, 1] 1 8

jhsxy2005的博客 4980

速腾RS-LiDAR-16激光雷达ROS配置全攻略:从硬件连接到Rviz点云可视化

本文详细介绍了速腾RS-LiDAR-16激光雷达在ROS环境中的配置与使用全攻略,涵盖硬件连接、网络配置、ROS驱动安装及Rviz点云可视化等关键步骤。通过实战案例和技术解析,帮助开发者快速实现激光雷达数据采集与处理,提升机器人感知系统的部署效率。

ooo22的博客 249

python新增练习(一)

s=input() print("{:=>25,}".format(int(s))) import turtle turtle.pensize(2) d=0 for i in range(1,13): turtle.fd(40) d += 30 turtle.seth(d) ls = [111, 222, 333, 444, 555, 666, 77...

NJU phd 在读。 801

GEE 案例分析:利用Landsat数据进行FAI、NDVI及CHLA分析并统计平均值(巢湖为例)

浮游藻类指数(FAI)、归一化植被指数(NDVI)及叶绿素a(CHLA)是水体环境监测的重要指标。本文利用Google Earth Engine(GEE)平台,基于Landsat 5和Landsat 8数据,进行水体藻类及植被监测。

此星光明博客 1336

猫群优化算法(CSO)详解:从生物灵感到智能优化

猫群优化算法(CSO)是一种模拟猫科动物行为的群体智能优化算法。该算法基于猫的两种主要行为模式:搜寻状态(全局探索)和跟踪状态(局部开发)。CSO通过混合率(MR)动态调整两种模式的比例,实现探索与开发的平衡。算法核心包括搜寻模式的变异操作和跟踪模式的速度-位移模型,具有收敛性能好、全局搜索能力强等特点。相比传统优化算法,CSO在高维复杂问题中表现优异,已成功应用于函数优化、图像处理等多个领域。算法性能受混合率、变化域等参数影响,自适应参数策略可进一步提升优化效果。

qq_42212808的博客 619

day005--python

python基础--基本语法 什么是编程语言 是用来定义计算机程序的形式语言。我们通过编程语言来编写程序代码,再通过语言处理程序执行向计算 机发送指令,让计算机完成对应的工作。 简单来说,编程语言就是人类和计算机进行交流的语言 python发展的背景 Python的作者,Guido von Rossum(吉多·范·罗苏姆,中国Python程序员都叫他 龟叔),荷兰 人。Python 本身也是由诸多其他语言发展而来的,Python目前有两个版本,Python2.x和Pyt

wzhdxtx_的博客 807

【Windows Server 2019】发布服务器 | 远程桌面服务的安装与配置 Ⅰ——理论,实验拓扑和安装基于RemoteAPP的RDS

博客介绍了Windows Server中远程桌面服务的理论,实验拓扑以及基于RemoteAPP的RDS安装。博文介绍了如何在Windows Server上部署发布服务器。

VMware, Windows, Linux, Cisco, Container, Kubernetes, Kali 6129

day 005 作业

目录 day 005 作业 一、输入姑娘的年龄后,进行以下判断: 二、预习while循环,打印1-100之间的奇数和 三、预习while循环,猜年龄游戏升级版,有以下三点要求: day 005 作业 一、输入姑娘的年龄后,进行以下判断: ...

diesouxi2722的博客 186

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

《Python数学编程》练习-day005:数值输入

《Python数学编程》练习-day005:数值输入 提示→《Python数学编程》练习系列往期笔记: Day1:《Python数学编程》练习-day001:斐波那契序列 Day2:《Python数学编程》练习-day002:分数操作 Day3:《Python数学编程》练习-day003:基本数学运算 Day4:《Python书序编程》练习-day004:复数 提示:菜鸟一枚,此系列文主要是用于我自己的学习记录,如果能对您有帮助,我荣幸至极。 文章目录《Python数学编程》练习-day005:数值输入前

feizhang231的博客 810

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

day 005总结

基本运算符 算术运算符 + - * / % // ** 比较运算符 > >= < <= == != #返回一个布尔值 赋值运算符 = += -= *= /= //= %= **= 逻辑运算符 and左右两个条件都为True,则为True,否则为False or左右两个条件只要有一个满足则为True,否则为False not 如果条件为True,则非False。如...

aimang0159的博客 116

深度学习工具包 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")

学习日志day005--python的数据类型

长度为三且各字符不同的子字符串,我们称这个字符串为好字符串, 给你一个字符串s,请你返回s中长度为3的好子字符串的数量, 注意:如果相同的好子字符串出现多次,每一次都应该被记录答案之中, 子字符串是一个字符串中连续的字符序列。从键盘输入一个字符串,判断这个字符串是不是回文字符串【使用下标】 回文字符串:满足对称性,第一个字符和倒数第一个字符相等, 第二个和倒数第二个字符相等……序列中的每个元素都分配一个数字 - 它的位置,或索引,第一个索引是0,第二个索引是1,依此类推。它们的调用需要在特定对象上进行‌。

Z211613347的博客 1346

Python学习day005

01位置实参 def pet_information(animal_type,pet_name): print("It's a "+animal_type+".") print("The "+animal_type+"'s name is "+pet_name.title()+".") #title()使所有字符串的所有单词以大写开始 pet_information("rabbit","yany") It's a rabbit. The rabbit's name is Yany.

qq_54670701的博客 139

day 005作业

输入姑娘的年龄后,进行以下判断: 如果姑娘小于18岁,打印“不接受未成年” 如果姑娘大于18岁小于25岁,打印“心动表白” 如果姑娘大于25岁小于45岁,打印“阿姨好” 如果姑娘大于45岁,打印“奶奶好” age=int(input('请输入年纪:')) if age>=45: print('奶奶好') elif age>=25: print('阿姨好')...

aimang0159的博客 237

day 005 笔记整理

目录 基本运算符 算术运算符 比较运算符 赋值运算符 逻辑运算 身份运算符 位运算符 成员运算符 python 运算符优先级 if 判断 单分支结构 if ....

diesouxi2722的博客 120

python学习day005--构造程序逻辑

通过一些经典的案例和习题,一方面帮助大家巩固之前所学的Python知识,另一方面帮助大家了解如何建立程序中的逻辑以及如何运用一些简单的算法解决现实中的问题。 练习一:寻找水仙花数 什么是水仙花数? 是一个三位数,每个位置上的数的立方和的和正好等于它本身。153=13+53+33 for x in range(100,1000): a=x%10 b=x//10%10 c=x/...

qq_43720551的博客 252

Day005

1.String类 2.stringBuffer类 3.Intenger类 4.Math类 5.File类 转载于:https://www.cnblogs.com/Aftersoon-sun/p/9715581.html

weixin_30710457的博客 102

笔记 day005

字典 (非序列类型) 声明: dict = {键名: 值, 键名:值} dict1 = { “name”:“张三”, “age”:20 } 索引: 按照键名索引。 dict1[“name”] 如果没有该键名,则报异常 dict1.get(“keyname”, defaultValue) 字典中键值对的修改 如果键名存在,则修改值 如果键名不存在,则新增一个键值对 dict1[“n...

Captain_DUDU的博客 185

day005-列表

1,认识列表 列表: 列表是容器型数据类型,将[ ]作为容器标志,里面多个元素用逗号隔开:[元素1, 元素2, 元素3, 元素4,…];列表是可变的(可变指的是元素的个数、值和顺序可变);列表是有序的(元素有固定位置信息–下标)。 元素: 任何Python支持的类型的数据都可以作为列表的元素,同一个列表的元素的类型可以不同,同一元素可以重复出现。 list1 = [] # 空列表 list2 = [10, 10, 20, '张三', 12.34] list3 = [10, 20, [1, 2]] li

lijianmingweibo的博客 105

[Python] 005-Python循环语句

Python循环语句

-- 438

PYTHON基础-DAY1 20210401

PYTHON基础-DAY1 目录PYTHON基础-DAY1001 python介绍002 python下载 安装 配置003 开发环境介绍—交互模式的使用IDLE介绍和使用004 IDLE开发环境的使用—建立Python源文件005 Python程序格式:缩进/行注释/段注释006 简单错误如何处理007 008 海龟绘图—图形化程序设计009 程序的构成010 对象的基本组成和内存示意图011 引用的本质:栈内存和堆内存012 标识符013 变量:声明、初始化、删除变量 001 python介绍 pyt

weixin_47442524的博客 171
上一篇: python(day004——基础知识4)
下一篇: python(day006——函数1)
王总总
博客等级 码龄8年 2粉丝 41原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值