create a function which tells if a number is prime

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 799 Views - Last Post: 26 August 2014 - 06:45 AM Rate Topic: -----

#16 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7898
  • View blog
  • Posts: 13,434
  • Joined: 19-March 11

Re: create a function which tells if a number is prime

Posted 26 August 2014 - 06:45 AM

View Postduanuys, on 26 August 2014 - 08:31 AM, said:

def is_prime(num):
	if num % 2 == 0:
		return False
	else:
		return True




Well yes, this does correct the indentation error. But it leaves the function fundamentally broken.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2