A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 5 years ago

I'm working on PS1a. While I have a general understanding of what I need to do, I'm a little lost as far as beginning my code. My first thought was to define what a prime number is in Python. I was thinking along the lines of something like: pn= a/a == 1 and a/1 == a These would be the two rules for primes: divisible only by 1 and itself. I'm stuck on getting the proper code going though. Can someone point me in the right direction? Also, is there a reference sheet explaining what Python key words, commands, etc all do? Thanks!

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Rather than focusing on what a prime number is, it may help to focus on what a prime number isn't. I realize that it sounds kind of funny. What I mean is, assume that the number is prime, then try to disprove the assumption. Hopefully I can explain: For example, try getting a list of numbers together and checking to see if there are any numbers (you only need to check numbers less than the candidate) that will divide with a remainder of 0. If so, they are not prime numbers. If you exhaust checking what a prime number isn't, then you know you have a prime number. I hope I didn't just confuse you more. Anyway, I find the official Python documentation very useful: http://docs.python.org/index.html.

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    That kind of helps. A big link I'm missing is that from lectures 1-2 and the reading, I'm not understanding how I'm supposed to come up with a program that does this. The lectures are kind of vague and leave lots of holes to be filled for me. Can you send me that link again? I can't get it to open. Thanks!

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Sorry, a period got pulled into the link last time: http://docs.python.org/index.html

  4. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...


  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.