Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

sebastianaro

  • 2 years ago

Hi, I'm using python 2.7.3. In the third lecture they hand out one exercise with the Dividors. Python is not showing me the result even with the (i,) correction they did. What's going on? Help?

  • This Question is Open
  1. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    the second lecture from edX, or OCW ?

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

    I made a mistake in my question is actually the 3rd lecture of OCW.

  3. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    x = 100 divisors = () for i in range(1, x): if x%i == 0: divisors = divisors + (i,) print divisors print divisors[0] + divisors[1] print divisors[2:4] this one?

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

    Oh yes, is that one, I didn't know you had to actually write print divisors and all the other things.

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

    you don't, just type x = 100 divisors = () for i in range(1, x): if x%i == 0: divisors = divisors + (i,) into a new window, and run with F5. then type the print statements into the shell and hit enter to run

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

    Thanks so much, now it works. In the handout it did not have print Divisors and the video I couldn't see that there was a print in the code. Thanks so much. I thought there was something wrong with my python. Thanks again! :D

  7. TuringTest
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    No problem, welcome!

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

    • Attachments:

Ask your own question

Ask a Question
Find more explanations on OpenStudy

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...

23

  • 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.