当前位置:网站首页>punch day05
punch day05
2022-08-02 07:11:00 【huixiaodezuotian】
"""The Python isdigit() method checks if a string consists of digits only, valid only for 0 and positive numbers.Syntax: str.isdigit()Parameters: noneReturn Value: Returns True if the string contains only numbers otherwise returns False."""str = '123456'print(str.isdigit())str = 'Hello, World!'print(str.isdigit())str = '-1'print(str.isdigit())def is_ip(ip):num_list = ip.split(".")for num in num_list:# igit means number, isdigit is to judge whether it is a number, 0 - 9 is a numberif not num.isdigit() or not 0<= int(num)<=255:return Falsereturn Trueprint(is_ip("10.289.122.55"))
Print result:
True
False
False
False
边栏推荐
猜你喜欢
触发器简单解释
MySQL (3)
nodejs的安装和全局配置(超详细哦)
npm does not recognize the "npm" item as the name of a cmdlet, function, script file, or runnable program.Please check the spelling of the name, and if the path is included, make sure the path is corr
HCIP 第三天实验
Nacos database configuration
有点奇怪!访问目的网址,主机能容器却不行
APT + Transform to realize multi module Application distributed Application life cycle
MySQL union query (multi-table query)
Node installation and configuration (node-v12.20.2-x64 ) and introduction to node version switching
随机推荐
直播系统聊天技术(八):vivo直播系统中IM消息模块的架构实践
node安装及环境变量配置
MySql 5.7.38下载安装教程 ,并实现在Navicat操作MySql
看图就懂|衡量业务增长健康的销售指标如何选择
node安装和配置(node-v12.20.2-x64 ) 以及node版本切换介绍
APP专项测试:流量测试
Point Density-Aware Voxels for LiDAR 3D Object Detection Paper Notes
NPM ---- 安装yarn
HCIP 第一天
[数据集][VOC]眼睛佩戴数据集VOC格式6000张
Go inside the basic knowledge
MySQL high-level --- storage engine, index, lock
8/1 思维+扩展欧几里得+树上dp
The stock price has repeatedly hit new lows, and the real estate SaaS giant is in trouble. How should Mingyuan Cloud transform and save itself?
Node installation and environment variable configuration
npm 和 yarn的区别
npm ---- install yarn
Dataset: A detailed guide to the download link collection of commonly used datasets in machine learning
npm does not recognize the "npm" item as the name of a cmdlet, function, script file, or runnable program.Please check the spelling of the name, and if the path is included, make sure the path is corr
Analysis of port 9848 error at startup of Nacos client (non-version upgrade problem)