当前位置:网站首页>请用已学过的知识编写程序,找出小甲鱼藏在下边这个长字符串中的密码,密码的埋藏点符合以下规律:
请用已学过的知识编写程序,找出小甲鱼藏在下边这个长字符串中的密码,密码的埋藏点符合以下规律:
2022-06-29 08:54:00 【qq_43614355】
小甲鱼
- 请用已学过的知识编写程序,找出小甲鱼藏在下边这个长字符串中的密码,密码的埋藏点符合以下规律:
a) 每位密码为单个小写字母
b) 每位密码的左右两边均有且只有三个大写字母
今天刚学完正则表达式然后看到这题,现在用正则表达式写感觉简单不少
import re # 导入re模块
def fn():
f = open('string2.txt','r')
a = f.read()
l = re.findall('[^A-Z]{1}[A-Z]{3}[a-z]{1}[A-Z]{3}[^A-Z]{1}',a)
'''选出符合题目要求的字母区间。中间为小写字母,密码的左右两边均有且只有三个大
写字母(说明两边三个大写字母之后只要是非大写字母的即满足条件),此时返回的是一个列表'''
for i in l: # 遍历列表
print(i[4],end=' ') # 打印第四个字母
fn()
边栏推荐
- Data visualization: the significance of data visualization
- GD32F4xx 以太網芯片(enc28j60)驅動移植
- Cloud management platform: openstack architecture design and detailed interpretation
- MH/T 6040航空材料烟密度试验
- Have you done the network security "physical examination" this year?
- Recursive RBAC menu level display infinite classification
- Pytorch summary learning series - data manipulation
- Wechat applet custom multi selector
- UE4 blueprint modify get a copy in array to reference
- 数据治理:元数据管理(第二篇)
猜你喜欢

Print service IP setting scheme

CROSSFORMER: A VERSATILE VISION TRANSFORMER BASED ON CROSS-SCALE ATTENTION

The principle of session and cookie

Research progress of target detection in the era of deep convolutional neural network

Automatic Multi-Organ SegmVentation on Abdominal CT With Dense V-Networks

Implementation of multi key state machine based on STM32 standard library

数据处理时代,数据质量建设才是企业的生存之道

GD32F4xx 以太網芯片(enc28j60)驅動移植

基于stm32标准库独立按键的多按键状态机的实现

Fabrication d'une calculatrice d'addition simple basée sur pyqt5 et Qt Designer
随机推荐
Pytorch learning summary - memory cost of operation
Iso16000-9 testing of volatile organic compounds in building products and furniture
Simplicity Studio无法识别新买的JLink v9解决方法
General part: cognition, design and best practice of prototype design
Deep Learning-based Automated Delineation of Head and Neck Malignant Lesions from PET Images
Making of simple addition calculator based on pyqt5 and QT Designer
证券账号开户安全吗?是靠谱的吗?
Construction and use of Changan chain go language smart contract environment
Gd32f4xx Ethernet chip (ENC28J60) driver migration
Leetcode skimming -- teponacci sequence
LSM6DSL之SPI驱动
长安链GO语言智能合约环境搭建及使用
Cloud management platform: openstack architecture design and detailed interpretation
UE4 在4.20-23版本安裝Datasmith插件
爱快安装或重置后,PC或手机端获取不到ip
Wechat applet user refuses to authorize geographic location information and calls up the authorization window again
Fully Automated Delineation of Gross Tumor Volume for Head and Neck Cancer on PET-CT Using Deep Lear
UE4 display 3D editable points in Viewport
Have you done the network security "physical examination" this year?
通用分页框架