Computer Networking — Python Practice

In this lab you will do a little play with Python.

A Python loop

Write a Python program that prompts for a numbers and does the following for each input.

Python lint

You should use the program pylint analyze your code. pylint is very helpful in finding syntax errors.

Python style

Python has an office style guide, PEP 8 - Style Guide for Python Code. If your program doesn’t conform to the style guide, pylint may complain.

Python IDE’s

Try out the two IDE’s available in the lab, idle and PyCharm (called simply charm).


Right now you are probably executing your program by typing:
    […]$ python
Many years before tweets contained hashtags, Unix scripts contained the hashbangs. Add a hashbang to your Python program and rename it so that you can type
    […]$ ./yourprogram
to run your Python program.