Write a python program to print the sum and the table of both numbers entered
Answers
Language:
Python
Program:
___________________________________________
a=int(input("Enter the number 1: "))
b=int(input("Enter the number 2: "))
c=int(input("Enter the last limit of table: "))
print("The sum is:",a+b)
print("The tables are: ")
for i in range(1,c+1):
print(f"{a}x{i}={a*i}\t{b}x{i}={b*i}")
___________________________________________
Output:
Enter the number of rows: 5
Enter the number 1: 2
Enter the number 2: 4
Enter the last limit of table: 10
The sum is: 6
The tables are:
2x1=2 4x1=4
2x2=4 4x2=8
2x3=6 4x3=12
2x4=8 4x4=16
2x5=10 4x5=20
2x6=12 4x6=24
2x7=14 4x7=28
2x8=16 4x8=32
2x9=18 4x9=36
2x10=20 4x10=40
Explanation:
- Accept, 1st and second number and the table limit in a variable.
- Print sum.
- Run loop and print table.
Answer:
a green pigment, present in all green plants and in cyanobacteria, which is responsible for the absorption of light to provide energy for photosynthesis.a green pigment, present in all green plants and in cyanobacteria, which is responsible for the absorption of light to provide energy for photosynthesis.a green pigment, present in all green plants and in cyanobacteria, which is responsible for the absorption of light to provide energy for photosynthesis.
Explanation:
a green pigment, present in all green plants and in cyanobacteria, which is responsible for the absorption of light to provide energy for photosynthesis.