'''\nWelcome to Py-ChemShell Tutorial!\n'''
# See: https://docs.python.org/3

### print ###
print(__doc__)
print("Hello World!")

# you can insert a quit() to stop the script anywhere
# quit()

### variables ###
a = 1
A = 100
print("\nThe value of a is", a, A)
print("The value of a is %d"%a)
print("The value of a is {}\n\n".format(a))

b = a
a = "chemshell"
print("a = \"{}\"\nb = {}".format(a,b))

# swap
a, b = b, a
print("a = {}\nb = {}\n\n".format(a,b))


### list ###
c = [ 1, 2, 3 ]
print("c =", c)
print("len(c) =", len(c))
print("c[1] =", c[1])
print("range(4) =", list(range(4)))
print("range(3,7) =", list(range(3,7)))
print("range(3,9,2) =", list(range(3,9,2)))
print()


### dictionary ###
d = { 'abc':123, 'xyz':c }
print("d['xyz'] =", d['xyz'])
print("d.keys() =", list(d.keys()))
print("\n\n")


### conditions ###
if True:
    print("False =", False)
if 1:
    print("None =", None)
if type(c) is list and len(c) > 0:
    print("c's type is", list)
if c[2] != 2 or c[2] == 3:
    print("c[2] == 3\n\n")

# this causes error by inconsistent indentation:
#if True:
#    print("c =", c)
#   print("c =", c)


### loops ###
for i in c:
    print("    i =", i)



