On 2022-06-07, Dave <d...@looktowindward.com> wrote:
> Hi,
>
> I’m new to Python and have a simple problem that I can’t seem to find the 
> answer.
>
> I want to test the first two characters of a string to check if the are 
> numeric (00 to 99) and if so remove the fist three chars from the string. 
>
> Example: if “05 Trinket” I want “Trinket”, but “Trinket” I still want 
> “Trinket”. I can’t for the life of work out how to do it in Python?


  s[3:] if s[0:2].isdigit() else s


> All the Best
> Dave
>

-- 
<StevenK> You're rewriting parts of Quake in *Python*?
<knghtbrd> MUAHAHAHA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to