Lets say we have this string: [18] [email protected]:pwd:
[email protected] is the email and pwd is the password.
Also, lets say we have this variable with a value
f = "[18] [email protected]:pwd:"
I would like to know if there is a way to make two other variables named var1 and var2, where the var1 variable will take the exact email info from variable f and var2 the exact password info from var2.
The result after running the app should be like:
var1 = "[email protected]"
and
var2 = "pwd"
>>> var1, var2, _ = "[18] [email protected]:pwd:"[5:].split(":")
>>> var1, var2
('[email protected]', 'pwd')
Or if the "[18]" is not a fixed prefix:
>>> var1, var2, _ = "[18] [email protected]:pwd:".split("] ")[1].split(":")
>>> var1, var2
('[email protected]', 'pwd')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With