Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 823 Bytes

Strings-ultimate-question-1-Python.md

File metadata and controls

24 lines (20 loc) · 823 Bytes
layout topic title language
exercise
Strings
Ultimate Question 1
Python

Write a function that prints:

The ultimate answer to the ultimate question of life, the universe, and
everything is: XXX.

Where XXX is either a string or a number that is passed to the function as a parameter. Use a format string to accomplish this. Use this function to print out the answer if the input parameter is 42, but don't actually do the printing from inside the function(think about why printing from outside the function might generally be more useful).

If you don't understand why this question is fun/funny you can Google it or, better yet, actually read Hitchhiker's Guide to the Galaxy, which is one of the funniest books ever written. There is also a very valuable programming lesson to this story.