Data types · 17 / 29 Exercise Easy

A number in several types

Objective

Create a Python program that reads a decimal number and shows it converted to other types.

Instructions

  • Read a decimal number with float(input()).
  • On the first line show its integer value (int, which discards the decimals).
  • On the second line show the number as text followed by a space and the € symbol.
  • On the third line show its logical value (bool): False if it is 0 and True otherwise.
Input
7.9
Output
7
7.9 €
True

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

Start exercise