Challenge: Embed a Variable in a String
Test yourself and implement what you have learned so far in this challenge.
We'll cover the following
Problem Statement
You are given two variables name
and age
which store a person’s name and age respectively. You have to embed name
and age
in a larger string and print the final string.
Input
The input is the variables name
and age
.
name
andage
have already been declared for you.
Output
The output will be the final string in which you will embed name
and age
.
Sample Input
"Ben", 18
Sample Output
"Ben is 18 years old."
Irrespective of the value of
name
andage
. The format of the string should match the format of the sample output.
Test Yourself
Write your code in the given area. Try the exercise by yourself first, but if you get stuck, the solution has been provided. Good luck!
//Write your code here
Let’s go over the solution review in the next lesson.