Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 3 years ago

Hello I made this line of code for the 12.2 in cspy which states : "As an exercise, create and print a Point object, and then use id to print the object’s unique identifier. Translate the hexadecimal form into decimal and confirm that they match.". The code works but only when I write 'print' instead of 'return', the 'print r' statement returns 'None' ?? Could someone explain why to me please ? Thank you code : http://pastebin.com/kDTMiH9Q

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

    In your code, as long as you pass a number that is divisable by 16, something is returned. But if the number is not, which is the case with 39619, you call dectohex again, but you do not return anything.

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

    Thanks a lot slotema ! It works fine with a return statement before the function call !

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