Skip to content

Commit

Permalink
Python int() function examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj Kumar committed Aug 23, 2018
1 parent 6b6ca3b commit b519cc3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Python-3/basic_examples/python_int_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
class Emp:
id = 0

# def __int__(self):
# print('__int__ function called')
# return self.id
#
# def __trunc__(self):
# print('__trunc__ function called')
# return self.id
def __int__(self):
print('__int__ function called')
return self.id

def __trunc__(self):
print('__trunc__ function called')
return self.id


x = Emp()
Expand Down

0 comments on commit b519cc3

Please sign in to comment.