Create number variables and print their types and values in Python

The assignment is to make number factors to store the whole number, buoy and complex number, we need to print their sorts and qualities additionally in python.

Python numbers

There are three kinds of numbers in python:

Whole number

Buoy number

Complex number

In the beneath given program, we are making various factors to store the numbers and printing their sorts and qualities.

Program

a = 10      # integer
b = 10.23   # float 
c = 10+2j   # complex

# printing types
print("type(a): ", type(a))
print("type(b): ", type(b))
print("type(c): ", type(c))

# printing values
print("value of a: ", a)
print("value of b: ", b)
print("value of c: ", c)

Output

Create number variables  and print their types and values in Python

Leave a Comment

error: Alert: Content is protected!!