
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Run a successful conversion and recover from a format error in the supplied app.
Download the complete learner resources for this course, including the Python source code, worked examples, reading companion, code explanations, testing materials and additional practical exercises.
Extract the downloaded ZIP files into a convenient folder on your computer and consult the included instructions before beginning the practical activities.
Individual lecture resources are also available throughout the course, allowing you to download the relevant materials as you progress.
Turn a small user task into observable requirements and independent acceptance cases.
Set up the learner files, run the local service and call the converter from a scratch file.
Derive both formulas, distinguish readings from changes and check the physical lower bound.
Read imports, conditions, function definitions and arithmetic expressions in sequence.
Define the accepted decimal pattern and diagnose why different entries are rejected.
Round exact fractions for display and test ties, carries and numbers near zero.
Join the parser, numeric branches and display using small Python functions and records.
Follow an exact value from entry to display and locate where a rejected reading stops.
Choose independent expected answers, iterate through cases and run focused tests.
Check the lower boundary, rounding policy and exact round trips in both directions.
Reproduce and correct a grouping error, a boundary error and a stale browser result.
Read the form markup and connect labels, instructions, destination and feedback.
Trace what edits and selection changes do and guard against delayed results.
Send the current values to the local Python process and place each reply on the form.
Review the contrast and focus styles and practise a keyboard-only conversion.
Read the code for the local service, its asset routes and its submission checks.
Compare Python test results, local service replies and the observable form behaviour.
Check a proposed change against the requirements and compare the evidence before keeping it.
Reuse the Python converter in a small terminal program and compare both interfaces.
Write and test a separate helper for changes in temperature.
Demonstrate a full sequence, explain one result aloud and write a repeatable handover.
In this practical lecture, you will learn how to process multiple temperature readings using the Python converter developed earlier in the course.
You will work with a CSV file containing ten sample readings, including valid Celsius and Fahrenheit temperatures, missing values, incorrectly formatted numbers and temperatures outside the accepted range.
Follow each reading through the program, examine the results and identify why individual entries are accepted or rejected. You will also learn how to preserve exact calculated values alongside rounded display results.
Finally, you will add your own temperature reading, predict the conversion result and verify it by running the program.
By the end of this lecture, you will understand how to test a Python program against a batch of inputs and check the results systematically.
In this practical lecture, you will investigate why rounding a calculated temperature before comparing it with a threshold can produce an incorrect decision.
Using the Python temperature converter, you will compare Fahrenheit readings converted to Celsius against a threshold of 20°C.
You will discover how different exact temperatures can produce the same rounded display value while belonging to different comparison categories.
The lecture demonstrates how to use Python's Fraction class to preserve numerical precision, apply inclusive threshold comparisons and write tests for readings immediately below, equal to and above a threshold.
You will also explore how to change the comparison threshold and verify that your program continues to produce correct results.
By the end of this lecture, you will be able to distinguish between a calculated value and its formatted display, and explain why precise comparisons are important when testing Python programs.
This course contains the use of artificial intelligence. AI was used only to read aloud the instructor's original script. No changes to wording or meaning were made. AI was used to create images following exact instructions, and the results were checked for accuracy by the instructor.
Build a small Python application that converts temperature readings between Celsius and Fahrenheit. You will start by running the finished converter, then work through the rules and code that make it work. You will convert familiar values by hand, check each step against a known answer and see what should happen when a person enters a value the app cannot accept.
You will learn to interpret a complete decimal entry, choose the correct formula and keep the exact numerical value until it is time to display an answer. You will write and run tests for both directions, values at absolute zero, errors and exact rounding ties. Three deliberate mistakes give you practice finding the line responsible for an unexpected result, correcting it and checking the rest of the app again.
Next, connect the calculation to a browser form that runs on your computer. Follow how the form sends the current values, shows a labelled result, gives specific feedback and clears an old answer when the entry changes. Practise the interaction with a keyboard and record what happened. In the final exercises, reuse the Python code in a terminal and build a separate helper for temperature changes.
The lectures explain the code in sequence and describe the important screen states aloud. The downloadable learner pack includes the runnable project, a structured reading companion, line-by-line code explanations and worked practice. You will need Python and a browser to run the examples. No previous programming is required.
Declaration: This course contains the use of artificial intelligence. AI was used only to read aloud the instructor's original script. No changes to wording or meaning were made. AI was used to create images following exact instructions, and the results were checked for accuracy by the instructor.