I am working with Ruby every day, but i have an issue in Python. I was found this languages very similar… But I have some problems with migration from Ruby 🙂
Please, help me to convert this action in python:
string = "qwerty2012"
(var, some_var, another_var) = string.unpack("a1a4a*")
this should return three variables with unpacked values from string:
var = "q" # a1
some_var = "wert" # a4
another_var = "y2012" # a*
Help me to represent it in Python
Thank you!
will do the assignment and yield respectively:
The above assignment makes use of slice notation as described by the Python Docs. This SO post Good Primer for Python Slice Notation gives a good explanation too.