P
P
pilityxxx2020-08-15 23:56:45
Python
pilityxxx, 2020-08-15 23:56:45

How to strip the first characters of a Python variable?

There is a variable -
a = 20202020-12-112020-12-11-12
The first 14 characters must be removed from it.
That is, the result should be - 2020-12-11-12

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
SKEPTIC, 2020-08-16
@pilityxxx

a = a[14:]

J
jameslotte, 2020-08-16
@jameslotte

You need to make a cut. Answer given above

A
alekssamos, 2020-08-16
@alekssamos

I will add: if this is not a string, wrap it in str ()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question