I want to slice my url from https://exemple.com/key-system-1?hwid=07f8f20b7419f622&zone=Europe/Rome
to hwid=07f8f20b7419f622.
I tried
url = "https://exemple.com/key-system-1?hwid=07f8f20b7419f622&zone=Europe/Rome"
uirl = url[: url.find("hwid")]
print (uirl)
But the result is
https://exemple.com/key-system-1?
The problem in your code is that you used
:wrong when you tried to slice the stringmeans that the new value of
urlis the part ofold_urlfrom 0 toindexand
means that the new value of
urlis the part ofold_urlfromindexto the end of `old_urlin conclusion to get the result you are locking for you could use the following code