X BOL wishing you a very and Happy New year

Alternative content

Python Numeric Variables and Types !

Python Numeric Variables and Types !

Last updated 2413 days ago by Rahul Nayak

Python is completely object oriented, and not "statically typed".

You do not need to declare variables before using them, or declare their type. Every variable in Python is an object.

To define an integer, use the following syntax in Script1: 

Numbers Script1.py

myintval = 7
print(myintval)

Run

python3 Script1.py

To define a floating point number, you may use one of the following notations in Script2:

Float Numbers Script2.py

myfloat = 7.0
print(myfloat)
myfloat = float(7)
print(myfloat)

Run

Python3 Script2.py