- Create and use meaningful variable names (such as distance, fare,
passengers) - Use appropriate data type for the variables
- Make sure the programming code (Python) is syntax error free
- Once you have completed the code , check for any logical errors
- Common errors usually spotted around using the operators such as <,>, <=,>=,
==,! = - If required use input function with prompt to collect values from the user such
as input(“Enter value for distance:”) - Use correct programming construct based on the question
- Selection (If else)
- iteration (For or While)
- Remember to use FOR loops , if you know the number of iteration and remember to use WHILE loop , if you don’t know the number of iteration
- Do provide the correct indentation suitably
- Use the colon in the correct places
- Remember = is used as an assignment operator and == used to validate a
condition - Read the question few more times
- Remember total and count calculation has to be done within the for / while loop,
whereas the average - Calculation has to be done outside the loop. Indentation
is the key here - Remember the index start at 0 (List index)
- Remember Functions need parameters and return statement
- Remember MOD (% in Python) – Mod operator will return the reminder
- Remember INT (// in Python) Integer division will return whole number and
ignore any decimals - Be sure to understand the difference between AND or OR logical operator
- Spend reasonable time to revise one dimensional and two dimensional array
(list in Python) - Be sure to revise about file handling (Read, write and append files)
Was this article helpful?
YesNo
