How to remove the first part of a string by substring in Python

1 Answer

0 votes
s = "python programming"

print(s)

s = s.lstrip("pyth")

print(s)




'''
run:

python programming 
on programming 

'''

 



answered Feb 5, 2021 by avibootz
edited Feb 5, 2021 by avibootz
...