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.
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.
Create the variables pet_name set to "Biscuit" and pet_age set to 4. Then print Biscuit is 4 years old using the two variables.
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 an augmented assignment operator so the program prints Steps: 7500.
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 will not run. One name starts with a digit and one is spelled with a different case later on. Fix both so it prints Winner: Lee then Runner-up: Kim.
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 shows a and b each time either changes, starting once both exist. Fill in the table.
a = 3 b = 8 a, b = b, a a += b b = b * 2
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: Use +=, -= and *= instead of repeating coins on both sides.
The program works but repeats each name on both sides. Rewrite every update with an augmented operator (+=, -= or *=). The output must stay Coins: 24.
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.
Write a short game round. Create a constant BONUS equal to 50, a score starting at 0 and lives starting at 3. Then, in order: add 120 to the score, lose one life, add the bonus, and double the score. Print Score: 340 and then Lives: 2.
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.