Hello, everyone
fori in range(len(seq2)):# get seq2 length and repeat for statement by length
If (i+2 < len(seq2)): # To prevent an i+2 string with a length of 4 and an index of 5.
word = seq2[i] + seq2[i+1] + seq2[i+2]
# I'll make a word
If word in seq2 : # Make sure the word is in the seq2 string!
print('Success:', word)
I'm going to find these three~
fori in range (len(seq2)):
if (i+2 < len(seq2)):
word = seq2[i] + seq2[i+1] + seq2[i+2]
print(word)
All I need to do is check if there is or not You can use if in grammar.
(Additional 1)
for i in range(len(seq2)):
if (i+2 < len(seq2)):
word = seq2[i] + seq2[i+1] + seq2[i+2]
print(word)
index = seq1.find(word)
if index != -1 :
print(the word f' you're looking for {word} is in [{index}:{index+len(word)-1}]')
(Additional 2)
Actually... LEA, PGV, DLK... There are two words that come out together. I have to write a regular expression. Please keep that in mind
import re
for i in range(len(seq2)):
if (i+2 < len(seq2)):
word = seq2[i] + seq2[i+1] + seq2[i+2]
index = seq1.find(word)
if index != -1:
indexes = [w.start() for w in re.finditer(word, seq1)]
print(the word you're looking for {word} in {indexes})
553 GDB gets version error when attempting to debug with the Presense SDK (IDE)
554 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
556 PHP ssh2_scp_send fails to send files as intended
765 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.