Created
July 31, 2022 13:48
-
-
Save neurojojo/1a4d0988247fae75e048980c69a02a72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class fileclass: | |
def __init__(self, input): | |
self.Filename = input | |
self.Size = os.path.getsize(input) | |
def summary(self): | |
print(f'File is named {self.Filename} and has size {self.Size}') | |
def __lt__(obj1, obj2): | |
if obj1.Size<obj2.Size: | |
print(f'{obj1.Filename} is smaller than {obj2.Filename}\n') | |
if obj2.Size<obj1.Size: | |
print(f'{obj2.Filename} is smaller than {obj1.Filename}\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment