Python Playground
Print in a Function & String Formatting
Learn how to use print() inside a function and how to format strings in Python using f-strings, .format(), and % formatting.
Run the code first so AI Tutor can see the latest output or error.
Python Playground
Print in a Function & String Formatting
Learn how to use print() inside a function and how to format strings in Python using f-strings, .format(), and % formatting.
Run the code first so AI Tutor can see the latest output or error.
Python Playground
Print in a Function & String Formatting
Learn how to use print() inside a function and how to format strings in Python using f-strings, .format(), and % formatting.
Run the code first so AI Tutor can see the latest output or error.
Python Challenge
Draw a Grid with Print
Write a function called draw_grid that prints a 2×2 grid that looks exactly like this:
+ - - - - + - - - - + | | | | | | | | | | | | + - - - - + - - - - + | | | | | | | | | | | | + - - - - + - - - - +
Hints:
print('+', '-')print moves to the next line. To stay on the same line, use end=' ':print('+', end=' ')print('-')Run the code first so AI Tutor can see the latest output or error.
Hints
Reference Solution
