Skip to content

Number Data Type Examples

Integer Data Type Example

age = 25

Int age (25) can be a whole number, positive or negative, without decimals, of unlimited length.

Examples:

  • 35656222554887711
  • -3255522
  • 25

Float Data Type Example

weight = 76.50

Float weight (76.50) can be a number, positive or negative, containing one or more decimals.

Examples:

  • 1.10
  • 1.0
  • -35.59
  • 35e3
  • 12E4
  • -87.7e100

Complex Data Type Example

something = 1j

Complex something (1j) are written with a "j" as the imaginary part.

Examples:

  • 1j
  • 3+2j
  • -4j

Type Cast Functions

Examples:

  • float(weight)
  • int(age)
  • complex() """