I just realized a super blunder, I have committed all my life
url = 'abcdc.com'
print url.strip('.com')
Expect: abcdc
Resut: abcd
Instead try
url.rsplit('.com', 1)
strip function takes in an array of characters and chops any pattern of characters in the array.. :(
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment