A
A
anton13ms2020-06-03 08:56:47
Python
anton13ms, 2020-06-03 08:56:47

How to find a string in Python if only part of it is known?

How to find a string in the list, part of which is known?
For example, there are lines like "20200503_2525", and the value after the underscore "2525" is different.
How to find exactly the lines in which at the beginning it is 20200503_ , and the following characters are whatever?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fedor Filipiev, 2020-06-03
@anton13ms

mystring = "20200503_2525"
if "20200503_ " in mystring:
   # Ваш код

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question