To be a good carpenter, you need to be able to identify and select the right tools to complete your project. For instance, the main wood working tools used by carpenters are:
It’s the same with programming. To be a good programmer, your need to be able to identify all the tools that are available to build a computer program. If you can name these tools, you will then be able to select the right tool when you need them!
When using procedural programming with a high level programming language like Python, the main tools of the programmer are:
Data Types (Integer, Float, String, Boolean) & casting values,
Computing Operators (assignment operator, arithmetic operators, comparison operators, Boolean operators)
Data Structures (e.g. lists and arrays)
String manipulation techniques (incl. String concatenation)
Subroutines (e.g. Procedures and Functions)
Libraries (e.g. random library, time library, etc.)
Task 1: Drag and Drop
Complete the fill in the gaps activity below to label all the programming terminology used in this Python program:
Programming TerminologyOpen in New Window
Task 2: Python Coding
Code this program online using trinket.io.
Task 3: Returning the change!
Update the above code, so that, when the user overpays, the program returns the change. For instance, if your customer overpays by £14, the output of your code would be:
Solution...The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area