Challenge: Embed a Variable in a String

Test yourself and implement what you have learned so far in this challenge.

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.


The input is the variables name and age.

name and age have already been declared for you.


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 and age. 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!

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy