You can use the ArcLength function:
ArcLength[Line[RandomReal[1, {30, 2}]]]
But unfortunately, that doesn't really teach anything about programming. If you want to learn more, you should try:
- Writing a function that finds the length of a single line.
- Writing a function that finds the length of a list of lines.