Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to combine this code? can you explain it step by step as well? what I'm hoping to do with this code is get a

How to combine this code?

can you explain it step by step as well?

what I'm hoping to do with this code is get a and b and inputting c using any number in order to print out "all" a and b values

def pythagoreanTriplets(limits) : c, m = 0, 2

# Limiting c would limit # all a, b and c while c < limits : # Now loop on n from 1 to m-1 for n in range(1, m) : a = m * m - n * n b = 2 * m * n c = m * m + n * n

# if c is greater than # limit then break it if c > limits : break

print(a, b)

m = m + 1 and

limit=int(input("Enter upper limit:")) c=0 m=2 while(climit): break if(a==0 or b==0 or c==0): break print(a,b) m=m+1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

1. Prepare a flowchart of Dr. Mahalees service encounters.

Answered: 1 week ago