Programming Flashcards
What can a program do?
-Read input
-Store data
-Calculate
-Write Output
-Iterate or Loop
-Compare and branch
-Sequence
What is pseudocode?
semi-programme language used to describe steps in an algorithm.
What is flow chart?
graphical representation of a programme
What is interactive mode Programming ?
mode that can be directly typed and the interpreter displays the results immediately
What is script mode programming?
test file containing Python statements. They are reusable
What is input data?
Input data is data needed to solve the problem
What is output data?
The resulting information
What are the three types of error?
Syntax Error
Runtime Error
Logical Error
Explain Syntax error
-code violating Python language
-Interpreter specifies the problem
Explain Runtime Error
-Program encounters unexpected conditions during execution
-e.g. division by zero
calling function that not exist
Explain Logical Error
-produces incorrect results
- incomplete understand about the problems
Two repetition in Python
Condition controlled structure (while)
Counter control structure (for)
Explain condition controlled (while)
-loop must be a statements
-use boolean expression
Explain count controlled (for)
-loop must be numbers
for loop vs while loop
“for” loop
-number of loops is known
-can have counter variables
-lop infinite times if not specified
“while” loop
-number of loops is unknown
-no control variable
-loop infinite until condition is met
-if condition not specified, it will shows error