Challenge 1
Parse the TOML string into Python data.
import tomllib
data = 'name = \"Foxipa\"'
config =
print(config["name"])
Press Ctrl⌘Enter to check your answer
Practice parsing TOML strings and files and handling parsed configuration data.
Challenge 1
import tomllib
data = 'name = \"Foxipa\"'
config =
print(config["name"])
Press Ctrl⌘Enter to check your answer
Challenge 2
import tomllib
from io import BytesIO
file = BytesIO(b'name = \"Foxipa\"\n')
config =
print(config)
Press Ctrl⌘Enter to check your answer
Challenge 3
config = {"server": {"host": "localhost"}}
host =
print(host)
Press Ctrl⌘Enter to check your answer
Challenge 4
from decimal import Decimal
import tomllib
config = tomllib.loads("price = 19.95", parse_float=)
print(config["price"])
Press Ctrl⌘Enter to check your answer