0

def h(n): f = 0 for i in range(1,n+1): if n%i == 0: f = f + 1 return(f == 2)

The function h(n) given above returns True for a positive number n whenever:  1) n is a multiple of 2 2)  n is a composite number 3)  n is a prime number 4 )  n has an even number of factors

16th Feb 2018, 3:20 AM
I Am a Baked Potato
I Am a Baked Potato - avatar
5 Respostas
0
f = 0 # must be definiert fitst def h(n): for i in range(0, n): if n%i == 0: f += f return(f) The function h(n) given above returns the number of even numbers in range n.
16th Feb 2018, 5:49 AM
Sebastian Keßler
Sebastian Keßler - avatar
0
2) n is a composite number. For any explanation regarding my answer, please let me know.
17th Aug 2018, 4:55 PM
KUNAL SHARMA
KUNAL SHARMA - avatar
0
KUNAL SHARMA explain your answer!
21st Aug 2018, 9:36 AM
Praneeth Sai Jv
Praneeth Sai Jv - avatar
0
how to develop the while loop programme
25th Aug 2018, 5:40 PM
Kuhile Suvarna Bhaginath
0
cant understand anything!!!
29th Jan 2020, 3:11 PM
sagnik sanyal
sagnik sanyal - avatar