Tuples and sets · 6 / 16 Exercise Easy

Point on a plane

Objective

Create a Python program that stores the coordinates of a point in a tuple and unpacks them to show them.

Instructions

  • Read two integers, x and y.
  • Store them in a tuple point = (x, y).
  • Unpack the tuple into two variables, a and b.
  • On the first line show Point: (a, b).
  • On the second line show Distance to the origin: D, with the distance sqrt(a² + b²) to two decimals.
Input
6
8
Output
Point: (6, 8)
Distance to the origin: 10.00

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise