2 Replies - 208 Views - Last Post: 08 July 2013 - 11:21 AM Rate Topic: -----

#1 datus  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 08-July 13

difference between // and % in python 3.3?

Posted 08 July 2013 - 11:01 AM

I am not getting difference between floor function// and modulo function % ....they both do the same thing....
so why we have two operators having same function?

thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: difference between // and % in python 3.3?

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2128
  • View blog
  • Posts: 3,260
  • Joined: 21-June 11

Re: difference between // and % in python 3.3?

Posted 08 July 2013 - 11:10 AM

No, they don't do the same thing. // returns the integer part of the result of the division, % returns the remainder.

This post has been edited by sepp2k: 08 July 2013 - 11:13 AM

Was This Post Helpful? 1
  • +
  • -

#3 datus  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 08-July 13

Re: difference between // and % in python 3.3?

Posted 08 July 2013 - 11:21 AM

uh ...got it
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1