当前位置:网站首页>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
边栏推荐
猜你喜欢

Not annotated parameter overrides @NonNullApi parameter

mysql索引失效的常见9种原因详解

Toolbox App 1.25 New Features at a Glance | Version Update

Detailed explanation of 9 common reasons for MySQL index failure

nacos安装配置和单机部署教程

MySQL索引常见面试题(2022版)

Kind of weird!Access the destination URL, the host can container but not

【21天学习挑战赛】顺序查找

Nodejs安装教程

MySQL高阶---存储引擎、索引、锁
随机推荐
Node installation and environment variable configuration
MySQL驱动jar包的下载--保姆教程
Not annotated parameter overrides @NonNullApi parameter
C# 编码规范手册
Write implicit join on view with jOOQ 3.14 synthetic foreign key
c语言指针运算
DNS的解析流程
leetcode solves the linked list merge problem in one step
APP special test: traffic test
MySQL高级-MVCC(超详细整理)
npm 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
Dataset:机器学习中常用数据集下载链接集合之详细攻略
MySQL Advanced Study Notes
NPM ---- 安装yarn
A detailed introduction to the deployment and usage of the Nacos registry
MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat
Toolbox App 1.25 新功能一览 | 版本更新
MySql 5.7.38下载安装教程 ,并实现在Navicat操作MySql
Node installation and configuration (node-v12.20.2-x64 ) and introduction to node version switching
能与观众实时互动的Claper