Lab, Getting Started
7 tasks, easy to hard: Predict, then run, Write it, Complete it, Fix it, Trace it, Refactor it, Mini challenge. Hints come one at a time and you can see each answer. Lab work is saved as practice and earns no XP.
Open the lessonYou can read every task below. Running, checking and saving them needs a free ID.
7 tasks
Task 01 .Type what the program will print, then run it to compare.
Type exactly what this program prints. Each line shows a type as <class '...'>.
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and save your practice. Practice does not award XP.
Task 02 .Solve it from the prompt, starting from an empty editor.
The variables a and b hold the text "25" and "17". Convert them and print their sum, 42.
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and save your practice. Practice does not award XP.
Task 03 .Fill the marked gaps in the starter code.
Replace each ___ with a conversion function so the program prints Temperature: 21.5 and then Rounded: 22.
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and save your practice. Practice does not award XP.
Task 04 .The starter code has a bug. Repair it so the checks pass.
This program stops with errors. Fix it so it prints Total weight: 5.25. Keep the weights as the given text and convert them.
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and save your practice. Practice does not award XP.
Task 05 .Fill the table with the variable values, step by step.
Each row is the value of value after it changes. Write each value as Python shows it: text in quotes, numbers without.
value = "7" value = int(value) value = value * 3 value = value / 2 value = str(value)
Sign in or create a free ID to fill in and check this table.
Task 06 .Rewrite working code to the stated rule, keeping the same output. Rule: Call int() only once and store the result in number.
The program converts the same text three times. Convert it once into a variable called number, then use that variable. The output must not change.
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and save your practice. Practice does not award XP.
Task 07 .A short task that combines this lesson with earlier ones.
An order form sent everything as text: pizzas = "3", price = "8.40" and people = "4". Print three lines exactly:
Total: 25.2Each: 6.3Each in whole pounds: 6
Round the share to 2 decimal places, and use int() for the last line.
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and save your practice. Practice does not award XP.