How to Create a Variable of Numeric Type in Python


In this example, we will learn how to create a variable of numeric type in Python.

Source Code

a = 5        # int
b = 6.8      # float
c = 2 + 3j   # complex

print(a)
print(b)
print(c)

Output:

5
6.8
(2+3j)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments