alexelias4137 alexelias4137
  • 30-11-2022
  • Computers and Technology
contestada

write a boolean function named is prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise.

Respuesta :

s284454 s284454
  • 30-11-2022

Answer:

if num > 1:

   for i in range(2,num):

       if (num % i) == 0:

           print(num,"is not a prime number")

           print(i,"times",num//i,"is",num)

           break

   else:

       print(num,"is a prime number")

Explanation:

Answer Link

Otras preguntas

Chapter CXLVIII An Act to provide for an exchange of lands with the Indians residing in any of the states or territories, and for their removal west of the rive
t=hp+2B solve for B in a literal equation
What's the most common act of terrorism in the 1800s
Write each fraction as a sum or difference 14-6x/19
Continental drift speed is 1x 10^-9 m/s. This is equivalent to a speed of
Which economic system do most countries operate under today?
name a number between 1 and 20 that has exactly 5 factors
Why were scribes important in Sumerian society?!
list some of the restrictions placed on black citizens in the louisiana parish
witch state was originally claimed by the Quakers