Answer :

Answer:

# Input three numbers

num1 = int(input("Enter the first number: "))

num2 = int(input("Enter the second number: "))

num3 = int(input("Enter the third number: "))

# Calculate the sum of the three numbers

sum = num1 + num2 + num3

# Calculate three times the sum

three_times_sum = 3 * sum

# Print the result

print("Three times the sum is:", three_times_sum)

Explanation:

## Step 1:

First, we need to write a Python program that calculates the sum of three given numbers.

## Step 2:

To do this, we declare three variables `num1`, `num2`, and `num3` to store the three given numbers.

## Step 3:

We then prompt the user to input the three numbers using the `input()` function and assign them to the respective variables.

## Step 4:

Next, we calculate the sum of the three numbers by adding them together and store the result in a variable called `sum`.

## Step 5:

After calculating the sum, we need to return three times the value of the sum. To do this, we multiply the sum by 3 and store the result in a variable called `three_times_sum`.

## Step 6:

Finally, we print the value of `three_times_sum` using the `print()` function.

#

Other Questions