TASK 1
Copy and run this code and explain the result.
>>>print hello world
TASK 2
Copy and run this code and explain the result.
>>>print("hello world")
TASK 3
Python produces different types of error. In your learning blog match the type of error with the description of error.
Type of error |
TypeError |
RuntimeError |
NameError |
ZeroDivisionError |
KeyBoardInterrupt |
Description of the error |
Dividing a number by zero. |
When a program is interrupted from the keyboard by pressing control+c. |
When a name is used that is not known about (often a variable name that is misspelt). |
When an operation is attempt that is invalid for that type of data. |
An error occurs when the program is running. TASK 4 |
Hint: A full list of Python errors can be found here:http://www.tutorialspoint.com/python/standard_exceptions.htm
TASK 5
Copy and run this code and explain the result.
# Programmer Amy Smith 6th September 2013
TASK 6
print("So long and thanks for all the fish")
print("The answer is",6*7)
Using the Python IDLE
Write your own summary sheet to describe how to run Python programs, including how to save and open .py files. Include any other commands that you have found useful.
Using the Python IDLE |
|
How to open a new window |
|
How to save a file |
|
How to open a file |
|
How to run a program |
|
|
|
|
|
|
|
Useful tips |
|
alt p | Displays the last line you entered |
Commands in the file are not colour coded | Save as a .py file |
|
|
|
|