foo(book):

Python

Public Domain

Just for screenshots

Download (right click, save as, rename as appropriate)

Embed

1
2
3
4
5
6
7
def foo(book):
   authors = {
      'Ringworld'  : 'Larry Niven',
      'Snow Crash' : 'Neal Stephenson',
      'Blindsight' : 'Peter Watts',
      }
   return authors[book]