当前位置:网站首页>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 classic 50 practice questions and the most detailed analysis of the whole network
- Leetcode parentheses matching problem -- 32. The longest parentheses effectively
- C# FileInfo类
- DNS resolution process
- rhce作业
- npm 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
- Launch Space on-premises deployment (local) Beta!
- Nacos安装详细过程
- MySQL Advanced SQL Statements
- MySQL Advanced SQL Statements (2)
猜你喜欢

NPM 安装指定版本包的方法及版本号查看

nodejs的安装和全局配置(超详细哦)
![[数据集][VOC]男女数据集voc格式6188张](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[数据集][VOC]男女数据集voc格式6188张

DNS的解析流程

Guarantee WIFI security in home and enterprise-with AC and AP networking experiment

MySQL高级学习笔记

Ant three sides: MQ message loss, duplication, backlog problem, what are the solutions?

Leetcode parentheses matching problem -- 32. The longest parentheses effectively

BGP+MPLS综合实验

SphereEx苗立尧:云原生架构下的Database Mesh研发实践
随机推荐
HCIP 第一天
nacos安装配置和单机部署教程
Node installation and configuration of environment variables
Point Density-Aware Voxels for LiDAR 3D Object Detection Paper Notes
MySql COUNT statistics function explanation
mysql高阶语句(一)
两篇不错的php debug教程
排雷小游戏(C语言)
人工神经网络
Node installation and configuration (node-v12.20.2-x64 ) and introduction to node version switching
科技赋能拉萨之“肺”,华为助力拉鲁湿地智慧管理守护绿水青山
typescript ‘props‘ is declared but its value is never read 解决办法
Leading the demand and justifying the HR value - the successful launch of the "Human Resource Leading Model HRLM"
MySQL 5.7 安装教程(全步骤、保姆级教程)
Kingdee International: Lost in half a year and last year, how does the business model of frantically burning money continue
aTrust项目的相关操作与分享
npm、cnpm的安装
APP专项测试:流量测试
Specified URL is not reachable,caused by :‘Read timed out
npm ---- install yarn