0% found this document useful (0 votes)
554 views4 pages

Python Worksheet 1: Task Completed

This document provides instructions for completing a Python worksheet assignment. It explains how to open the Idle program to write Python code, use the shell to perform basic math calculations, and use the editor to write code. It demonstrates printing a simple statement and running the code. The document tests the user's understanding with multiple choice and short answer questions about key Python concepts covered, like syntax, functions, and using Idle.

Uploaded by

Walid Sassi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
554 views4 pages

Python Worksheet 1: Task Completed

This document provides instructions for completing a Python worksheet assignment. It explains how to open the Idle program to write Python code, use the shell to perform basic math calculations, and use the editor to write code. It demonstrates printing a simple statement and running the code. The document tests the user's understanding with multiple choice and short answer questions about key Python concepts covered, like syntax, functions, and using Idle.

Uploaded by

Walid Sassi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Name: Date:

Python worksheet 1
Task Completed

1 Open Idle on your computer. Idle is the program that allows you to write your 
Python code.

Click the Type Idle and open


Idle (Python 3.6). You will open the shell of the Idle program.

windows
button.

2 The shell is used to type basic code. For instance, you can do some basic Maths 
calculations. Type the following calculations followed by the enter key. Write the
answer next to each one.

 a) 3*3
 b) 48/3
 c) 270 + 426
 d) 155578 – 1234
 e) 8 ** 2

You will see that each calculation takes the same time to complete and that we use different mathematical
operators for multiply and divide in Python than when we are doing Maths in our exercise books.

3 When we write our code in Idle we don’t usually use the shell. Instead we use the 
editor. Open the editor on your computer.

Click File >


Your new window should Save As
Click File> New File look like this Save in documents with a relevant
folder and the filename ‘Hello
world’

Python
Python is its own language and it has its own syntax. This is the structure of
statements and words in that are used in Python. A bit like English has its own
structure of sentences and words and so do other languages such as Spanish or Urdu.
There are other computer programming languages such as Java or C++.
Chrdol72 Page 1 of 4
Name: Date:

Print statements
By using the print function, you can produce simple statements.

The print command here is colour coded. It is purple and that means it is part of the Python library.
Python functions are case-sensitive which means they
must always be in lower case (small letters). The
statement you wish to ‘output’ must be inside
opening and closing brackets and speech marks. If you have done this correctly, it will appear in
green.

4 Type the code shown above into your Idle editor and run the code. 

Running your code

Click F5 on the top row of your Click OK to save Your code will output in the
keyboard shell

Success – you have now created your first Python program.

Question Mark
1 What is the name of the program used to write Python code? 1

…………………………………………………………………………………………………………….
2 The following describes something important in programming: 1

“The structure of statements and words in a computer language”.

What does it describe? (Tick 1)


 a) Loops
Chrdol72 Page 2 of 4
Name: Date:

 b) syntax
 c) variables
 d) code
3 3
Mathematical Symbol
Operation
Addition +
Subtraction
Multiplication
Division
Fill in the missing symbols from the table above

4 What happens if you type in the 2 * 3 and then press enter? 1


 a) It produces the value 6
 b) It produces a syntax error
 c) It produces the value 5
 d) Nothing
5 Explain what has happened with 8**2 that was calculated earlier. Why has it 1
produced this value?

…………………………………………………………………………………………………………….
6 What part of idle is used to do most of your coding? 1
 a) The editor
 b) The shell
 c) The Python window
 d) The file

Question Mark
7 What part of idle is shown here? 1

 a) The editor
 b) The shell
 c) The Python window
 d) The file
8 Which key is used to run your code? 1
Chrdol72 Page 3 of 4
Name: Date:

 a) F4
 b) F1
 c) F5
 d) Enter
9 When you run your code, what area of Idle does your code run in? 1
 a) The editor
 b) The shell
 c) The Python window
 d) The file
10 2

There are 2 syntax errors in the code above. Describe what they are.

Error 1 ………………………………………………………………………………………………….

Error 2 ………………………………………………………………………………………………….
11 Is the following statement true or false? 1
Python functions are case-sensitive.

…………………………………………………………………………………………………………….

Chrdol72 Page 4 of 4

You might also like