Temperature converter

Converts Celsius to Fahrenheit. Teaches decimal numbers and rounding.

Open in Tokbit Level: Beginner. Free in the browser, nothing to install, no account needed.

Run the example in Tokbit and step through it: before each step say what will happen and check it in the Variables panel. Then change it your way.

Flowchart

Flowchart of the Temperature converter example

Python program

The same program as Python code. In Tokbit you see it when you switch from Diagram to Python above the flowchart.

"""Converts Celsius to Fahrenheit. Teaches decimal numbers."""
c: float
c = float(input("Temperature in degrees Celsius:"))
# The conversion formula: F = C · 9 / 5 + 32.
f: float = c * 9 / 5 + 32
print(c, "C is", round(f, 1), "F")

Follow-up tasks

Tasks in which you change the example (with a model solution):

All examples