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 theprint()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!