Question: Python Script Show me how to print the computation of each even number plus the odd number equal to calc to the terminal as detailed

Python Script
Show me how to print the computation of each even number plus the odd number equal to calc to the terminal as detailed below:
For example print out "2+1=3","2+3=
5","2+5=7","2+7=9","2+9=11",2+11=13","2+13=15","2+15=17","2+19=21", then "4+1=5","4+3=7", and so on for the user to see the output on screen for all the values even and odd above ending with "19+19=38".
even_sum =0
odd_sum =0
for num in range(1,20):
if num %2==0:
even_sum += num
print(f"Even: {num}")
else:
odd_sum += num
print(f"Odd: {num}")
calc = even_sum + odd_sum
print(f"Even + Odd ={calc}")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!