Screw ===== We represent the code of a screw thread as a string that begins with the character ``'M'``, then follows its diameter (``int``), a hyphen, the thread pitch (``float``), the character 'x' and the screw length (``int``). All measures are in mm. For example, the thread code ``'M3-0.50x10'`` stands for a thread with a 3mm diameter, a pitch of 0.5mm, and a length of 10 mm. A code is incorrect if it does not begin with the character ``'M'`` or if it does not contain the characters ``'-'`` or ``'x'`` or they are not in the correct order (``'-'`` before ``'x'``). Write a function :py:func:`screw` that takes a string with a thread code, and returns its measures (diameter, pitch and length). If the code is not correct, then the function must return the string ``'code error'``. Save this function into the file named ``screw.py``. Examples: .. literalinclude:: test-screw.txt :language: python3 :lines: 3- .. note:: More tests are provided in the :download:`test-screw.txt` file. .. rubric:: Solution A solution of these functions is provided in the :download:`screw.py` file.