Calculate the multiplication and sum of two numbers

Here’s an example Python code to calculate the multiplication and sum of two numbers:

num1 = 10
num2 = 5

# calculate multiplication
multiplication = num1 * num2

# calculate sum
sum = num1 + num2

print("Multiplication: ", multiplication)
print("Sum: ", sum)

In this example, we have assigned the values 10 and 5 to num1 and num2, respectively. Then we calculate the multiplication by multiplying num1 and num2 using the * operator and assign the result to the variable multiplication. Similarly, we calculate the sum by adding num1 and num2 using the + operator and assign the result to the variable sum.

Finally, we print out the values of multiplication and sum using the print() function. When you run this code, it should output:

Multiplication: 50
Sum: 15

Note that you can replace num1 and num2 with any other values you want to perform the multiplication and sum operation on.

Related Examples

1. Python Program to Print Hello world!

2. Python Program to Find the Square Root

3. Python Program to Calculate the Area of a Triangle

4. Python Program to Solve Quadratic Equation

5. Python Program to Swap Two Variables

6. Python Program to Generate a Random Number

7. Return the count of a given substring from a string

8. Print the following pattern

9. Python Program to check if the given number is a palindrome number

10. Python Program to print multiplication table form 1 to 10

11. Print downward Half-Pyramid Pattern with Star (asterisk)

12. Python Program to Convert Kilometers to Miles

13. Python Program to Check if a Number is Positive, Negative or 0

14. Python Program to Find the Sum of Natural Numbers

15. Print the sum of the current number and the previous number in Python

Leave a Reply

Your email address will not be published. Required fields are marked *

Wordpress Social Share Plugin powered by Ultimatelysocial
Wordpress Social Share Plugin powered by Ultimatelysocial