Basics
#
# basics.py
#
# Comments are specified by the octothorpe (hashtag) `#`.
# You declare a variable by assigning it.
# In Python, the variable's type is dynamic: both the type and
# value of a variable can change. All types are reference types:
# every variable refers to an object, but the class can change.
# The basic types in Python are similar to the wrapper types
# Integer, Float, etc. in Java.
= 5 # integer
x print("x:", x)
= 1.23 # float
x print("x:", x)
= "hello" # string
x print("x:", x)
= True # boolean
x print("x:", x)
Output:
x: 5
x: 1.23
x: hello
x: True