...

Web Technologies - PYTHON

Back to Course

Lesson Description


Lession - #265 Python Numbers


There are three numeric types in Python:

  • int
  • float
  • complex

    variables of numeric kinds are made when you allocate a value to them.

    Example


    x = 1 # int
    y = 2.8 # float
    z = 1j # complex

    To verify the type of any article in Python, utilize the type(>
    function.

    Let's see a example

    
    x = 1
    y = 3565622257711
    z = -3255522
    a = 2.4564
    b = -85.7e10 
    c = -3.5
    d =  1 + 4j
    
    print(type(x>
    >
    print(type(y>
    >
    print(type(z>
    >
    print(type(a>
    >
    print(type(b>
    >
    print(type(c>
    >
    print(type(d>
    >

    Output


    Try it here