Python Forum
stupidly easy hw that I need help with
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
stupidly easy hw that I need help with
#5
Quote:(tippy/100) 
Because you're using python2, and because tippy is an int, if you do any calculations, you'll still have an int (the decimal part is ignored).  So 10 / 100 is 0, not the 0.1 you expect.  Instead, divide by 100.0, so python switches to a float, so the decimal value is kept.

That's more complicated than it needs to be, and that's not how it works in python3.
Reply


Messages In This Thread
RE: stupidly easy hw that I need help with - by nilamo - Sep-13-2017, 08:38 PM

Forum Jump:

User Panel Messages

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