livepython.net

145. Fix the Indentation in a Python Function

EasySpacing

Overview

Inside a block, every line must line up exactly. This function has two lines that don't.

Problem Statement

The starter code should print a ticket, but it stops with an IndentationError. Fix the indentation so that every line inside the function uses exactly 4 spaces, as PEP 8 says. It should print:

Ticket for Lucky
Seat: 12
Enjoy the show!

Input

No input is required for this question.

Output

Ticket for Lucky
Seat: 12
Enjoy the show!

Learn this firstChapter 16 · Python Indentation, Spacing and Line Length (PEP 8)
solution.py
def print_ticket(name, seat):
    print("Ticket for", name)
  print("Seat:", seat)
      print("Enjoy the show!")


print_ticket("Lucky", 12)

EXPECTED OUTPUT

1Ticket for Lucky
2Seat: 12
3Enjoy the show!

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.