Data Structure and Algorithm | is prime number

Pubblicato il: 30 settembre 2024
sul canale di: LeetMotions
18
1

Write a function, is_prime, that takes in a number as an argument. The function should return a boolean indicating whether or not the given number is prime.

A prime number is a number that is only divisible by two distinct numbers: 1 and itself.

For example, 7 is a prime because it is only divisible by 1 and 7. For example, 6 is not a prime because it is divisible by 1, 2, 3, and 6.

You can assume that the input number is a positive integer.


In questa pagina del sito puoi guardare il video online Data Structure and Algorithm | is prime number della durata di ore minuti seconda in buona qualità , che l'utente ha caricato LeetMotions 30 settembre 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 18 volte e gli è piaciuto 1 spettatori. Buona visione!