190,470 views
36 votes
36 votes
Write a program in Python and explain how we do the program

User EngineerDanny
by
2.9k points

2 Answers

16 votes
16 votes

Answer:

num1 = 1.5

num2 = 6.3

sum = num1 + num2

print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))

Step-by-step explanation:

This program adds up two numbers.

  1. num1 = 1.5 means that a variable called num1 has been assigned to the number 1.5
  2. num2 = 6.3 means that a variable called num2 has been assigned to the value 6.3
  3. sum = num1 + num2 means that the variables num1 and num2 have been added together and their total has been assigned to the new variable sum
  4. print('The sum of {0} and {1} is {2}'.format(num1, num2, sum)) means that the text that will be printed shall read out the sum of their answers formatted with brackets that are kept in place of their respective variables.
User Tri
by
3.3k points
15 votes
15 votes

please send what program, I will help you.