Skip to content
In this chapter

Advanced Programming Techniques in Python

Subsection

This is a subsection.

python
# This is some Python code
print(2 + 2)
# This is some Python code
print(2 + 2)

That was some code.

Let's try some bullets:

  • This is the first thing.
  • Another thing.
    • Nested bullets.
    • More nested bullets.
  • Third thing.

Here is a code snippet.

python
10 ** 2
10 ** 2

Here is some example code:

python
if i % 2 == 0:
    print('Even')
else:
    print('Odd')
if i % 2 == 0:
    print('Even')
else:
    print('Odd')

Here is entire file:

python
'''

Multiline docstring comment
More lines

'''
class Test:
    pass

# Try out some stuff

x=(
    # region computation
    10 ** 2
    # endregion computation
)

def evenodd():
    print("Let's count")
    for i in range(10):
        # Process even/odd
        # region evenodd
        if i % 2 == 0:
            print('Even')
        else:
            print('Odd')
        # endregion evenodd
        print(i)
'''

Multiline docstring comment
More lines

'''
class Test:
    pass

# Try out some stuff

x=(
    # region computation
    10 ** 2
    # endregion computation
)

def evenodd():
    print("Let's count")
    for i in range(10):
        # Process even/odd
        # region evenodd
        if i % 2 == 0:
            print('Even')
        else:
            print('Odd')
        # endregion evenodd
        print(i)
Listing 1 The entire file as an example.

That was the example.

About the author

The author while biking
The author while biking

Nathan Whitehead is a professional software developer and sometime educator. He has been programming since he was 8 and finding bugs in his code since the same time. He received his PhD in computer science from the University of California, Santa Cruz. He has taught classes in mathematics, programming, and computer science. Most recently he has worked at NVIDIA® doing software development. He lives in Boise, Idaho.

Witty message here.