History

Our Sponsors



Download BioinformaticsOnline(BOL) Apps in your chrome browser.




Python Numeric Variables and Types !: Revision

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