Managing exceptions in Python

From Computer Science Wiki
Revision as of 10:27, 10 March 2016 by Bmackenty (talk | contribs)

Introduction[edit]

The list type is a container that holds a number of other objects, in a given order. The list type implements the sequence protocol, and also allows you to add and remove objects from the sequence.[1]

Lists are a primitive data type, very, very helpful for storing and changing data.

Example of a function[edit]

try:
    number = input("Enter a number ")
    print("Your number was: " + str(number))
except NameError:
    print("Please use a number.")

This example was swiped from the official Python documentation which you should read. [2]

References[edit]