Module 0: Advanced Practice

You've grasped the basics. Let's solidify your understanding with more challenging tasks!

Anatomy Revisited

Let's look closer. This code uses `print()` multiple times, including one to create a blank line. Click each highlighted part to identify its role. The explanations will appear below (scroll if needed!).

# First, greet the user print("Welcome, Master Coder!") print() # Print a blank line for spacing print("Let's begin.")

Identify all 13 parts!

Build Multiple Print Statements

Drag the pieces to construct two lines of Python code in the drop zone below. Line 1 should print: `"AI is powerful."` Line 2 should print: `"Handle with care."`

Drop pieces here to build two lines...

Advanced Code Simulator

Write Python code in the editor to produce the following output exactly, including the blank line between the text lines:

> Line One

> Line Three
Use three separate `print()` commands. Add a comment explaining the purpose of the second `print()`.

Output will appear here...

Spot the Tricky Comment

Comments can be tricky! Click on all lines below that are entirely comments or contain a comment at the end. Remember the rules!

Code Correction Challenge

Uh oh! Spot the errors in each snippet and type the corrected code in the editor below it. Check for typos, missing symbols, and correct `print()` usage.

Challenge 1: Wrong Function Name

Goal: Print the text "Syntax matters!"

prnt("Syntax matters!")

Challenge 2: Missing Parentheses

Goal: Print the text "Python is fun"

print "Python is fun"

Challenge 3: Missing Quotes

Goal: Print the text: Hello

print(Hello)

Output Prediction

Read the Python code snippets carefully. What will each one actually print? Select the correct output. Pay close attention to comments and blank `print()` calls! If you get it wrong, you can try again.

Prediction 1

print("Step 1") # Skip Step 2 for now print("Step 3")

Prediction 2

print("Start") # Begin process print() print("End")

Advanced Mini Missions!

Final challenge! Complete these missions precisely. Pay attention to exact text, blank lines, and comment placement. The required output is shown below each mission.

Mission 1: Precise Greeting

Write Python code to print the following two lines exactly:

> Hello, Pythonista!
> Ready to code?

Mission 2: Message with Spacer

Print the message "Processing...", then print a blank line, then print "Done.". Use three `print()` commands. Required output:

> Processing...

> Done.

Mission 3: Comment First, Then Print

First, write a comment: `# Displaying status.` On the next line, print the text: `Status: OK`. Required output:

> Status: OK

Mission 4: Print with Trailing Comment

Print the text `"Important message"`. Add a comment *after* the code on the same line: `# Needs attention`. Required output:

> Important message

Advanced Practice Mastered!

Outstanding! You've conquered the advanced challenges for Module 0.
You have a strong grasp of `print()` and comments. Time for the video lesson!