当前位置:网站首页>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
边栏推荐
- Specified URL is not reachable,caused by :‘Read timed out
- Node installation and configuration (node-v12.20.2-x64 ) and introduction to node version switching
- MySQL classic 50 practice questions and the most detailed analysis of the whole network
- 武汉高性能计算大会2022举办,高性能计算生态发展再添新动力
- HCIP 第三天实验
- MySQL高级学习笔记
- [Cartoon] 2021 full score programmer behavior comparison table (latest version)
- MySQL high-level --- storage engine, index, lock
- Nacos注册中心的部署与用法详细介绍
- postgres 多个变量填充字符串,字串格式化
猜你喜欢
随机推荐
HCIP BGP综合实验 建立对等体、路由反射器、联邦、路由宣告及聚合
MySQL Advanced Statements (1)
BGP+MPLS Comprehensive Experiment
SphereEx苗立尧:云原生架构下的Database Mesh研发实践
Go inside the basic knowledge
Mining game (C language)
反向解析dns服务器
c语言指针运算
排雷小游戏(C语言)
.NET静态代码织入——肉夹馍(Rougamo) 发布1.1.0
MySql - there is no insert, there is update or ignored
MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat
leetcode-338.比特位计数
A detailed introduction to the deployment and usage of the Nacos registry
人工神经网络
Nacos客户端启动出现9848端口错误分析(非版本升级问题)
MySQL驱动jar包的下载--保姆教程
go里面的基本知识
zabbix auto-discovery and auto-registration
Nacos注册中心的部署与用法详细介绍









