livepython.net

4. Python Program to Print a Message and a Calculation in One Line

Easyprint() basics

Overview

This task focuses on combining a string with a mathematical operation in one single print statement. By solving this, you will practice using Python's print() function and performing basic arithmetic within it.

Problem Statement

Write a Python program that outputs the following:

the sum of 5 and 9 is 14

  • Do not directly type the final number (e.g., 14) into the print statement.
  • Instead, perform the actual addition using a mathematical expression (e.g., 5 + 9) inside the print() function so Python calculates the result for you.

Input

  • No input is required.

Output

The program should output the exact sentence:

the sum of 5 and 9 is 14

Take your time and happy coding!

Learn this firstChapter 2 · Python print() Function: Show Text and Numbers
solution.py
# write your code here

EXPECTED OUTPUT

1the sum of 5 and 9 is 14

YOUR OUTPUT

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