当前位置:网站首页>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 Advanced Statements (1)
- MySQL高级语句(一)
- MySQL driver jar package download -- nanny tutorial
- Technology empowers Lhasa's "lungs", Huawei helps Lalu Wetland Smart Management to protect lucid waters and lush mountains
- HCIP 第一天
- leetcode-338.比特位计数
- APT + Transform 实现多模块应用Application生命周期分发
- MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat
- nodejs的安装和全局配置(超详细哦)
- C# Coding Conventions Handbook
猜你喜欢

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

node安装及环境变量配置

Node installation and configuration (node-v12.20.2-x64 ) and introduction to node version switching

npm、nrm两种方式查看源和切换镜像

Point Density-Aware Voxels for LiDAR 3D Object Detection Paper Notes

Leading the demand and justifying the HR value - the successful launch of the "Human Resource Leading Model HRLM"

Reverse resolve dns server

Nacos数据库配置

MySQL classic 50 practice questions and the most detailed analysis of the whole network

Analysis of port 9848 error at startup of Nacos client (non-version upgrade problem)
随机推荐
Toolbox App 1.25 新功能一览 | 版本更新
rhce homework
MySQL高阶---存储引擎、索引、锁
能与观众实时互动的Claper
Nacos installation configuration and single-machine deployment tutorial
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?
Xgboost报错 ValueError: Invalid shape: (1650, 2) for label
DNS resolution process
Guarantee WIFI security in home and enterprise-with AC and AP networking experiment
MySQL 5.7 installation tutorial (full-step, nanny-level tutorial)
npm、cnpm的安装
MySQL高级语句(一)
Difference between npm and yarn
BGP+MPLS综合实验
MySQL Index Common Interview Questions (2022 Edition)
[数据集][VOC]男女数据集voc格式6188张
武汉高性能计算大会2022举办,高性能计算生态发展再添新动力
Node installation and environment variable configuration
postgres 多个变量填充字符串,字串格式化
BGP+MPLS Comprehensive Experiment