A Few Things to Try

  • Angry boss. Write an angry boss program that rudely asks what you want. Whatever you answer, the angry boss should yell it back to you and then fire you. For example, if you type in I want a raise, it should yell back like this:

    WHADDAYA MEAN "I WANT A RAISE"?!? YOU'RE FIRED!!
  • Table of contents. Here’s something for you to do in order to play around more with center, ljust, and rjust: write a program that will display a table of contents so that it looks like this:

    Table of Contents
    Chapter 1: Getting Started page 1
    Chapter 2: Numbers page 9
    Chapter 3: Letters page 13

Get Learn to Program, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.