livepython.net

56. Python Program to Calculate Age in Months

EasyInteractive

Overview

Input, process, output: a name and a number in, a sentence out.

Problem Statement

Read a name, then an age in whole years, and print the age in months. For example, for Sunny and 14, print:

Sunny is 168 months old

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

One value per line, in this order. Example:

Sunny
14

Output

The output for that example:

Sunny is 168 months old

The tests try 3 different inputs.

Learn this firstChapter 7 · Build Small Interactive Python Programs
solution.py
# write your code here

EXPECTED OUTPUT

1Sunny is 168 months old

YOUR OUTPUT

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