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

who invaded the indus valley in 326 BC
(MC)What was the main purpose of the Interstate Commerce Act of 1887? A. to ensure the spread of manufacturing across the frontier B. to remove import taxes fo
Show all work: 2 + 6 ÷ 3 − 5 =
When a flying bug hits a moving train, no effect is observed on the train because?
can someone help with english?
Fill in the blank with the correct form of gustar.me _____ el chocolate.
Six sandwiches are being divided evenly by 4 friends.how many sandwiches will each friend get.
-22t>66 a. t >3 b. t <3 c. t <-3 d. t>-3
A truck driver travels 495 miles in 9 hours. What is the driver's speed in miles per hour. A. 55 miles per hour B. 60 miles per hour C. 65 miles per hour D. 75
Please what is the answer