Skip to main content
Engineering LibreTexts

11.8: Exercises

  • Page ID
    16872
  • Exercise \(\PageIndex{1}\)

    Use a web browser to go to the Python website http://python.org. This page contains information about Python and links to Python-related pages, and it gives you the ability to search the Python documentation.

    For example, if you enter print in the search window, the first link that appears is the documentation of the print statement. At this point, not all of it will make sense to you, but it is good to know where it is.

    Exercise \(\PageIndex{2}\)

    Start the Python interpreter and type help() to start the online help utility. Or you can type help('print') to get information about the print statement.

    If this example doesn’t work, you may need to install additional Python documentation or set an environment variable; the details depend on your operating system and version of Python.

    Exercise \(\PageIndex{3}\)

    Start the Python interpreter and use it as a calculator. Python’s syntax for math operations is almost the same as standard mathematical notation. For example, the symbols +, - and / denote addition, subtraction and division, as you would expect. The symbol for multiplication is *.

    If you run a 10 kilometer race in 43 minutes 30 seconds, what is your average time per mile? What is your average speed in miles per hour? (Hint: there are 1.61 kilometers in a mile).