O'Reilly logo

Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython by Richard Hightower

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting It All Together: The Address Book Example

In Chapter 4, we used an address book application to demonstrate the if, for, and while statements. We're bringing it back to review the concepts we've learned so far.

name = "   "
while (name != ""):
       name = raw_input("Enter in the name: ")
       if (name == ""):
             continue
       elif (name == "quit"):
             break
       phone_number = raw_input("Enter in the phone number: ")
       address_line1 = raw_input("Enter address line one: ")
       if (address_line1 == ""):
             continue
       address_line2 = raw_input("Enter address line two: ")
       address_line3 = raw_input("Enter address line three: ")
       #do something useful with the addresses
else:
       print("send the email to Rick")
       #emailAddresses("rick_m_hightower@emailcompany.com")

Organization

The first ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required