半臻 半臻
3年前
Python基础2——类型转换、深浅拷贝、函数
8、类型转换、深浅拷贝8.1数据转换数据类型int整型float浮点数bool布尔值complex复数str字符串list列表tuple元组dict字典set集合python类型转换int()numint("123")ifnum123:print("等于123")num123nstr(num)
Souleigh ✨ Souleigh ✨
4年前
JS - typeof 与 instanceof
一、typeoftypeof操作符返回一个字符串,表示未经计算的操作数的类型使用方法如下:typeof operandtypeof(operand)operand表示对象或原始值的表达式,其类型将被返回举个例子typeof 1 // 'number'typeof '1' // 'string'
Easter79 Easter79
3年前
string.Compare用法
string.Compare方法,用来比较2个字符串值得大小string.Compare(strA,strB,true);返回值:1:str1大于str20:str1等于str2\1:str1小于str2publicvoidCompareString(stringstrA,stringstrB)
Python进阶者 Python进阶者
2年前
我想的是将Date那一列转换成时间格式,怎么破?
大家好,我是皮皮。一、前言前几天在Python白银交流群【Joker】问了一个Pandas处理字符串的问题,提问截图如下:二、实现过程这里【甯同学】给了一个代码,示例代码如下所示:importpandasaspddfpd.readexcel('S当然了,这
DevOpSec DevOpSec
4年前
python 保留两位小数方法
保留两位小数,并做四舍五入处理方法一:使用字符串格式化a12.345print("%.2f"%a)12.35方法二:使用round内置函数a12.345a1round(a,2)print(a1)12.35方法三:使用decimal模块fromdecimalimportDeci
Easter79 Easter79
3年前
SpringMVC【开发Controller】详解
前言本文主要是讲解在Controller中的开发,主要的知识点有如下:编码过滤器使用注解开发注解@RequestMapping详解业务方法接收参数字符串转日期重定向和转发返回JSONSpringMVC过滤编码器在SpringMVC的控制
Stella981 Stella981
3年前
Mongodb之数据类型
一.MongoDB的数据类型Object ID:Documents自生成的\_idString:字符串,必须是utf8Boolean:布尔值,true或者false(Python中TrueFalse首字母大写)Integer:整数(Int32Int64你们就知道有个Int就行了,一般我
Wesley13 Wesley13
3年前
2.Redis数据类型
Redis中存储数据是通过keyvalue存储的,对于value的类型有以下几种:字符串Hash类型ListSetSortedSet(zset)注:在redis中的命令语句中,命令是忽略大小写的,而key是不忽略大小写的。1String类型1.1  命令
Wesley13 Wesley13
3年前
C语言宏定义中#用法
宏中""和""的用法一、一般用法我们使用把宏参数变为一个字符串,用把两个宏参数贴合在一起.用法:#include<cstdio#include<climitsusing namespace std;define STR(s)     sdefine CONS(a,b)  int
Wesley13 Wesley13
3年前
PHP 随机数 C扩展随机数
由于要用到固定长度的随机字符串。首先是一段PHP代码        $str_md5md5(uniqid());$rand  mt_rand(1, 28);$str1substr($str_md5,$rand,6);$rand  mt_rand(1, 28);$str2substr($