0% found this document useful (0 votes)
5 views

6.1 (Python) - Summary

Uploaded by

tran phuong
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

6.1 (Python) - Summary

Uploaded by

tran phuong
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

LEARNING OUTCOMES

For this unit, you need to be able to:


 7P.01 Identify and describe data types in text-based programs, including Integer, Real and String.
 7P.02 Know how to develop text-based programs that use input and output.
 7P.03 Know how to develop text-based programs using data types, including Integer, Real, and
String.
 7P.04 Know how to use variables in text-based programs.
 7P.05 Know how to develop text-based programs that use different arithmetic operators,
including +, -, *, /.
 7P.08 Know how to apply test plans.
 7P.09 Understand how errors can be introduced into programs.
 7P.10 Know how to systematically identify and debug errors in text-based programs.
 7CT.02 Know how to create algorithms using flowchart symbols.
 7CT.04 Understand and use selection statements, limited to IF, THEN, ELSE, presented as
flowcharts.
 7CT.05 Predict the outcome of flowcharts that use selection.
 7CT.07 Follow, understand, edit and correct algorithms that use sub-routines.
 7CT.08 Select and use appropriate constructs in algorithms written as flowcharts, limited to
sequence and selection.
 7CT.09 Select and use appropriate comparison operators in algorithms, limited to <, >, <=, >=, ==
(equal to) and != (not equal to).

PYTHON POSTCARD
https://drive.google.com/open?id=1EkWaAkM5LEZJ3uyXlKeplZTD_aiAxod4&usp=drive_fs

KEY VOCABULARY
Software Software is a set of instructions that tell a computer what to do.
Flowchart A diagram showing the sequence of actions in a computer program; a
graphical representation to show the steps to solve a problem.
Input This is when data goes into the computer e.g. typing on a keyboard,
clicking a mouse
Processing This is when the computer calculates, does maths, thinks.
Output This is when the computer gives us information e.g. displaying (printing)
text/image on the screen, playing sounds on the speakers
Print statement print() is the function that Python uses to output text onto the screen.
Execute Another word for running a program.
Variable A named memory location used to store data of a given type during
program execution; a variable can change value as the program runs.
Data type A particular way in which a computer can store data.
String A data type for storing combinations of letters, numbers or any
characters on the keyboard.
Integer Whole number.
Real A data type for storing any number with a decimal point, such as 1.2 or
56.8.
Float Another name for the data type "real". Any number with a decimal point,
such as 1.2 or 56.8.
Input function input() is a function that Python uses to capture string data from users.
Casting The process of ensuring data is set to the correct data type.
int() casts data to an integer
float() casts data to an real
Algorithm A sequence of steps or instructions to solve a problem.
Debug/Debugging The process of identifying and removing errors from a computer
program.
Test plan A structured (step-by-step) approach to testing whether your solution
works as expected; a document that describes the areas of a program to
be tested – includes details of the tests to be applied to each area of the
program, including test data and expected results.
Selection A programming construct with more than one possible pathway; a
condition is tested (using a question or criterion) before deciding which
pathway to follow (the output).
Condition Something that is checked to determine whether it is true or false.
Indentation Code is indented when it does not start on the far left. We indent code
by pressing TAB on the keyboard.
Colon The : symbol.
Comparison operators Symbols used to compare values, e.g. >= meaning greater than or equal
to.
Sub-routine A mini program inside a program that can be completed or repeated
when requested.

FLOWCHARTS

 All paths in the flowchart must begin with Start and end with Stop.

 One instruction per shape.

 Arrows go up/down or left/right.


 Make sure you include "INPUT" or "OUTPUT" at the top of parallelograms.

 Subroutines use this shape:

COMPARISON OPERATORS
Operator Meaning Example True/False

> Greater than 44 > 5 True

< Less than 33<20 False

== Equal to 10==20 False

!= Not equal to 5 != 2 True

>= Greater than OR equal to 20>=20 True

<= Less than OR equal to 5<=10 True


MISCONCEPTIONS
The data type of input() is always a string. You need to add
int() or float() to change it

What data type is the variable a?


It is a string

What data type is the variable a?


IT IS STILL A STRING

What data type is the variable a?


IT IS STILL A STRING

To make it an integer you MUST use int( )

To make it into a real, use float( )

You might also like