2021年1月20日星期三

Trying to write a function that says if they are relatively prime numbers. Where is my error?

I'm trying to write a function that returns true or false after taking two separate integers as an argument and determines whether or not they are relatively prime numbers. I'm getting the correct output sometimes, but not all the time. Does anyone know what the issue here could be? Here's my code.

def is_relatively_prime(n, m):  while m != 0:      n % m      return(n, m) == 1  
https://stackoverflow.com/questions/65819661/trying-to-write-a-function-that-says-if-they-are-relatively-prime-numbers-where January 21, 2021 at 08:39AM

没有评论:

发表评论