Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: What is wrong with my code???
Post: RE: What is wrong with my code???

(Sep-16-2020, 01:40 PM)perfringo Wrote: You could consider more general approach to this function. If objective is to determine whether number is prime or not then the answer can be yes or no whic...
MrLeads General Coding Help 15 5,113 Sep-16-2020, 02:00 PM
    Thread: What is wrong with my code???
Post: RE: What is wrong with my code???

(Sep-16-2020, 11:54 AM)ebolisa Wrote: Your code fails!! You may learn some from here https://www.programiz.com/python-program...s/odd-even Nevermind. Your prime/not prime odd/even q was confusing....
MrLeads General Coding Help 15 5,113 Sep-16-2020, 12:00 PM
    Thread: What is wrong with my code???
Post: RE: What is wrong with my code???

(Sep-15-2020, 03:48 PM)DPaul Wrote: I suspect this may be a language issue. Prime/Not prime or even/uneven(odd) Because 15 is not "prime". Paul I got your point here. Yes the program here is actuall...
MrLeads General Coding Help 15 5,113 Sep-16-2020, 10:38 AM
    Thread: What is wrong with my code???
Post: RE: What is wrong with my code???

(Sep-15-2020, 01:28 PM)ndc85430 Wrote: Those break statements are unnecessary as they'll never be reached. Also, is your logic correct for the else branch? Do you really want to return as soon as y...
MrLeads General Coding Help 15 5,113 Sep-15-2020, 02:09 PM
    Thread: What is wrong with my code???
Post: RE: What is wrong with my code???

(Sep-15-2020, 10:02 AM)DPaul Wrote: 1) You print everything twice, you only need to call the function, not print it. 2) better still: insert a "return" statement into the function with the appropria...
MrLeads General Coding Help 15 5,113 Sep-15-2020, 10:31 AM
    Thread: What is wrong with my code???
Post: What is wrong with my code???

Can anyone please help me with the problem with this code- def prime_num(a): if a>1: for x in range(2,a): if (a%x)==0: print("The number is NOT PRIME") b...
MrLeads General Coding Help 15 5,113 Sep-15-2020, 09:49 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020