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.
Read the program and type exactly what it prints, line by line. Then run it to check.
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.
Write a program that prints Hello, Python! on the first line and I am learning to code. on the second.
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 ___ so the program prints how many hours are in a week: Hours in a week: then 168.
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 a NameError. Read the error, then fix the program so it prints Total: 9.
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 score after it changes. Fill in every row, top to bottom.
score = 1 score = score + 2 score = score * 10 score = score - 5
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: Calculate the number with 60 * 60 instead of typing 3600.
The program prints the right answer, but the number was worked out by hand. Rewrite the second line so Python calculates 60 * 60 itself. The output must stay the same.
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.
You are buying snacks for a party. There are 3 bags of crisps at 2 each and 4 drinks at 1 each. Print three lines exactly:
Crisps: 6Drinks: 4Total: 10
Let Python calculate every number.
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.