Python-字符串转浮点型,列表转字符串

关于python常见类型之间的转换 关于python常见类型之间的转换python常见类型转换前言创建几个类型变量整型int转换成其他类型浮点型float转换成其他类型字符串类型转换字符串转换成列表:字符串转换成元组:列表转换成字符串:元组转换成字符串: python常见类型转换 整型、浮点、字符串、列表和元组之间的强制转换。 前言 了解强制转换前,需要对python的数据类型有所了解,知道整型、浮点、字符串、列表和元组的概念; 同... 阅读详情

应用场景

爬虫过程中,采集的数据常以str或float存入数据库;

  1. 遇到含小数点的文本,需要转换成浮点型
  2. xpath()或re.findall()提取信息返回列表,列表可能为空,不便存进数据库。

字符串转浮点型

  • float
a = float('-1.21')
print(a)
  • numpy
import numpy as np
ls = ['1.2', '3', '-0.5']
array = np.array(ls)
array = array.astype(float)
print(array)
  • pandas
import pandas as pd
d = {'num': ['-0.5', '1', '1.2']}
df = pd.DataFrame(d)
num = pd.to_numeric(df['num'])
print(num)

取列表中的元素 并 转字符串

取列表第一个元素

ls1 = []
ls2 = [' a', 'b']
a = ls1[0].strip() if ls1 else ''
print(a)
a = ls2[0].strip() if ls2 else ''
print(a)

取列表全部元素

ls1 = []
ls2 = ['\ta', '\nb\xa0']
a = '|'.join(ls1)
print(a)
a = '|'.join([i.strip() for i in ls2])
print(a)
爬虫005_python类型转换_其他类型转换为整型_转换为Float类型_转换为字符串_转换为布尔值---python工作笔记023 然后字符串转换为int,要注意 不能有特殊字符比如1.23 中有点 就报错。boolean转换为int true是1 false 是0。可以看到字符串,只要不是空字符串,转换为布尔,都是true。然后列表只要不是空列表,转换为布尔,都是true。字典也一样,只要不是空的,转换为布尔都是true。元组,只要不是空元组,转换为布尔,都是true。然后再看int转换为布尔,返回true。可以看到,字符串,转换为浮点数。浮点数1.0转换为布尔是true。-1.0转换为布尔也是true。然后int转换成字符串。 阅读详情

相关推荐

IPSec Over GRE和GRE Over IPSec技术

IPSec Over GRE 和 GRE Over IPSec 一. 技术介绍 IPsec     主要作用是对数据进行加密,因为他能提供所有有时候被单独用作实现加密的一种方法!IPsec建立的是一个逻辑隧道,并不是真正意义上的隧道!并且不能提供路由功能,因为IPsec不支持非ip流量,也不支持广播(组播)! GRE     (通用路由封装)能很好的提供一个真正意义上的点对点的隧道,GRE是一种三层VPN封装技术。GRE可以对某些网络层协议(如IPX、Apple Talk、IP等)的报文进行封装,使封装后

qq_56228347的博客 9870

python %f格式化输出float的三种用法

f是python内置的格式化输出符号,主要用于输出浮点数,一般需要跟print()内置函数进行搭配使用。下面的内容将介绍三种%f的用法。二、%f输出指定小数点后位数的用法。三、%m.nf输出指定位数的用法。一、%f输出浮点数的基本用法。python %f三种用法。

weixin_47378963的博客 9290

通达信主力检测利器

主力轨迹:100*EMA(EMA(MTM,N1),N1)/EMA(EMA(ABS(MTM),N1),N1),COLORWHITE;主力拉高:IF(VAR51<REF(VAR51,1),VAR51,0),COLORYELLOW,NODRAW;洗盘:IF(VAR5<REF(VAR5,1),VAR5,0),COLOR000079,NODRAW;主力进场:IF(VAR5>REF(VAR5,1),VAR5,0),COLORRED,NODRAW;MAZL:MA(主力轨迹,N2),COLORYELLOW;

zhibiaogong的博客 7468

python中oxf2是多少_全网最细 Python 格式化输出用法讲解(推荐)

一、使用 print() 函数在 Python 中,print() 函数支持格式化输出,与 C 语言的 printf 类似。1. 格式化输出字符串和整数【示例1】输出字符串 AmoXiang,并计算、输出它的字符长度str1 = "%s.length = %d" % ("AmoXiang", len("AmoXiang"))print(str1) # 输出AmoXiang.length = 8% ...

weixin_32324637的博客 4902

告别Arduino IDE!用VSCode搭建Arduino UNO R3开发环境(含代码补全配置)

本文详细指导如何用VSCode替代Arduino IDE搭建Arduino UNO R3开发环境,包含代码补全配置和高效开发技巧。通过安装必要插件、配置项目结构和优化工作流,可显著提升开发效率,特别适合复杂项目开发。文章还提供了常见问题解决方案和高级功能调优方法。

weixin_30698297的博客 480

《遥感大模型生产级实战:从数据到决策的端到端AI工程》系列第一部分:AI遥感工程师的基础设施与工具链-文章 4:传统遥感分析与机器学习基线

本章将系统性地介绍经典遥感分析工作流,从数据预处理到多维度特征工程,再到如何利用经典的机器学习模型(如随机森林、支持向量机)进行监督与非监督学习。我们将通过一个完整的“智慧农业作物分类”项目实战,展示如何利用我们之前构建的数据湖和工具链,从原始数据到最终的分析结果,构建一个性能可靠、可解释性强的基线系统。更重要的是,我们将深入剖析这种传统方法的局限性,从而为后续章节引入遥感大模型的必要性提供强有力的论证。

panshengwu的博客 707

从零开始学Python编程之格式化输出

因此,如果我们要格式化输出有符号整数,可以使用百分号%d,如果要输出无符号整数,可以使用其他的符号。在本节中,我们将会讲解的是格式化输出,这不再是简单地使用print函数输出字符串,而是要输出一种带格式的数据给用户。在本篇文章中,老师给大家列出了许多符号,但是需要注意的是,我们在工作中常用的格式化符号只有前三个:百分号%s、百分号%d和百分号%f。在这里需要注意一下,如果我们在%d符号前面加上一个数字,表示输出的数字长度,如果这个数字比要输出的数字长度短,那么输出的结果就会在前面补0。

岛上程序猿 830

从平面到立体:一张图看懂MOSFET、FinFET到GAAFET的演变史(附结构对比图)

本文深入解析了半导体晶体管从平面MOSFET到三维FinFET,再到全环绕栅极GAAFET的技术演进历程。通过结构对比图和物理原理分析,揭示了每一次创新如何解决短沟道效应等关键挑战,推动芯片性能提升。特别关注GAAFET作为最新技术突破的架构特点和性能优势。

weixin_30892037的博客 699

python 浮点数四则运算与格式化输出

试编程实现分两行输入两个非零浮点数,并在4 行中按顺序输出两个数的加、减、乘、除的计算式和计算结果。计算结果str.format()方法严格保留小数点后3位数字。要求输出与如下示例格式相同,符号前后各有一个空格。Python 可以方便的实现计算器的功能。数学意义上的加、减、乘、除在Python中分别以符号“+、-、*、/”表示。浮点数1 + 浮点数2 = 和。浮点数1 - 浮点数2 = 差。浮点数1 * 浮点数2 = 积。浮点数1 / 浮点数2 = 商。

2302_77258274的博客 9478

超详细!动态规划详解分析(典型例题分析和对比,附源码)

为啥要使用动态规划?什么时候使用动态规划?以下是我的一些理解和心得,如果你感兴趣,就接着往下看吧。 对您有帮助的话记得给我点个赞哟! 动态规划的基本思想 动态规划(Dynamic Programming,DP)算法通常用于求解某种具有最优性质的问题。在这类问题中,可能会有许多可行解,每一个解都对应一个值,我们希望找到具有最优值的解。 动态规划算法与分治法类似,其基本思想也是将待求解的问题分解成若干个子问题,先求解子问题,然后从这些子问题的解中 得到原有问题的解。与分治法不同的是,动态规划经分解后得到的子问题

qq_44398094的博客 8万+

tsfknn 预测R语言中的时间序列

rolling参数应该设置为FALSE,这使得最后的18个观测值成为测试集,其余的作为训练集;如果我们将rolling参数设置为默认值TRUE,那么测试集就不会是一个恒定的向量。lag 滞后参数表示时间序列数据的滞后值。在这个例子中,由于我们的时间序列数据是月度的,我们将参数设置为1:12。作为药品福利计划的一部分,澳大利亚健康保险委员会记录的属于ATC代码A10的产品的每月政府支出(百万美元)。我们将使用tsfknn包,它可以用来预测R语言中的时间序列。格式:ts类别的月度时间序列。

Mrrunsen的博客 325

Python将字符串转换为浮点数

We can convert a string to float in Python using float() function. It’s a built-in function to convert an object to floating point number. Internally float() function calls specified object __float__(...

从零开始的教程世界 4万+

24、无人机能耗模型与上下文质量管理的研究

本文系统介绍了无人机能耗模型与上下文质量管理的研究进展。详细阐述了Dorling、Stolaroff、Kirchstein和Tseng等经典能耗模型的原理及特点,并基于LSTM架构构建了数据驱动的能耗预测模型,实验表明其预测精度显著优于传统模型。此外,还探讨了物联网环境中的上下文质量管理问题,引入了conQeng框架,以提升上下文选择、测量和验证的效率与可靠性。研究为无人机能耗优化和物联网上下文管理提供了理论支持和技术方案。

palm99的专栏 345

Python 列表元素类型转换总结

将列表变为字符或整型,使用“”.join(map()),join函数格式为‘seq’.join(seq),sep为分割符,可以为空,seq为要连接的字符串,元组,字典等,即以sep为分隔符将seq所有元素合并成一个新的字符串。Python列表通常可以包含整型,字符串,浮点型数据,甚至还可以包含另一个列表,本文主要使用Python函数,实例展示其中整型,字符串的转换。例2:字符串转换为元组,再以列表返回。列表中字符串变为整型(浮点型)列表中整型(浮点型)变为字符串。整型列表变为一个整型数字。

CITYDATA 3285

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

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

PythonGuides 博客中文翻译(十)

原文:PythonGuides Blog 协议:CC BY-NC-SA 4.0 在 Python 中将元组转换为字符串 原文:https://pythonguides.com/convert-tuple-to-string-in-python/ 在本 Python 教程中,我们将讨论在 Python 中 将 tuple 转换为 string 的不同方法。我们都知道一个元组在一个变量中存储几个条目。它也是一个固定的、组织良好的数据集合。 而字符串是用单方括号或双方括号括起来的一组字符。 如何使用

龙哥盟 1402

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

Python变量类型转换

首先介绍一下变量类型测试:type() #整型类型测试 num=100 ty=type(num) print(ty) #结果为<class 'int'> #对象类型测试 class Person: def say(self): print('hello') obj=Person() ty=type(obj) print(ty) #结果为<class '__main__.Person'> 如上代码,测试得num为int型 注意:空集合是num=se

weixin_47982238的博客 449

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

python float转str_python 数据类型互相转换

关注本号,教你更多python知识python中, 有6种数据类型, 那它们之间能不能互相转换?怎样转换? 这篇就来说说, 数据类型之间的转换数据类型之间的转换, 主要有以下函数1int()将其它类型转为整型int(x=0)->integerint(x, base=10) -> integer浮点型:会去掉小数部分In [1]: int(1.0) ...

weixin_39550379的博客 9103

Python数据类型转换

1.数字转字符串 实例:   a = 1   b = str(a) 2.数字转浮点型 实例:   a = 1   b = float(a) 3.字符串转列表 实例:  a = "1 2 3 4 5"  b = a.split() #以空格为分隔符、降字符串a转换为列表 print(type(b))print(b) 结果如下: <class 'list'...

weixin_30797199的博客 119

python不同数据类型之间的相互转换(关于整型/字符型/列表等的转换)

python数据类型转换 有时候录入的数据并不是自己所需要的数据类型,则需要对数据类型之间进行相互转化,下面给出几个数据类型的转化。 int(x) 将x转化为整数 float(x) 将x转化为一个浮点数 str(x) 将x转化为字符串 chr(x) 将整数转化为一个字符 list(x) 将序列x转换为列表 关于int(x)使用举例: x=13.5567 type(x) #输出为:float x=int(x) type(x) #输出为:int 其他转化与之类似。 关于数据框的数据类型转换举例,s

m0_46352099的博客 3579

Python基本操作(五) 标准数据类型(不可变类型)

1.标准数据类型 不可变类型: (1)数值型(number) (2)字符串(string) 容器类型:(可变类型) (1)列表(list) (2)元组(tuple) (3)集合(set) (4)字典() ...

哈伦2019的博客 263

python两个文件可以交互吗_python 文件交互 操作

python2数据类型是有int和long区别的 type(2**32) int type(2**64) longpython3里面是没有long的概念的,长整型大概理解小数就是浮点数科学计数法也是浮点数 E代表秘52.3E4 52.3 x 10**4布尔值真和假1和10数据运算andornotinnot in身份运算isis not计算机中能表示的最小单位是一个二进制位计算机中能存储的最小单...

weixin_36339710的博客 227

【无标题】类型转化

# # 将输入的字符串 转化为整型 str字符串的意思 # password = input("请输入数字密码:") # print("密码是:", password) # print("密码的数据类型是:", type(password)) # print("===============================") # # # 将password转换为整型 password 必须是纯数字 # password_int = int(password) # print("密码是:", passwo.

m0_67287136的博客 285

python变量/分支/循环/数组/列表/元组/序列

       最近比较流行python,于是我这种从不赶潮流的人也决定跟一把潮流。工作原因学习时间有限,好容易挤着时间看了一部分网上的视频,却被劝说没什么用处,我们就是靠java吃饭的。当然多学一种语言也不会有什么坏处,既然开始了,那就应该坚持,不管对错,不管是否有用都要把它学完。下面是学习笔记: -----------------------------------Bif及打印----01--...

manongxiaomei的博客 469

学习python的第一天

一.注释: # 单行注释 ''' ''' 多行注释 二.变量 1.标识符命名要规范

Uncrowned_king的博客 479

4.python数据类型之间的转换

总结:浮点型可以转换成整型,但是小数部分的数据会丢失,而字符串转换为整型,带小数点的数字字符串无法直接转换成整型,不带小数点的数字字符串可以直接转换成整型。Python 数据类型转换,本质是让不同类型的数据能一起运算、处理、输出,否则会直接报错或结果错误。总结:由上面的案例可以看出,带有数字的字符是可以转换成浮点数的,但是含有单词字母无法转换成浮点型。报错了,带小数点的数字字符串无法直接转换成整型。不带小数点的数字字符串可以·直接转换成整型。

weixin_74327171的博客 43

1.python的数据类型

Python中常见的数据类型: 数字类型 整型(整数 int) a = 5 浮点型 pi =- 3.14 复数 a + bj 用的很少 布尔类型 表示为真和假 值可以为True和False 在内存中是以1和0进行存储的 本质上是整型 >>> True + True # => 1 >>> 3 > 2 # => True # 表示性别 gender = True # 男 gender = False # 女 字符串类型

qq_54730385的博客 529
上一篇: 前程无忧——爬虫+数据分析
下一篇: Python selenium 模拟浏览器:输入+点击
小基基o_O
博客等级 码龄9年 4414粉丝 467原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

打赏作者

小基基o_O

您的鼓励是我创作的巨大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值