Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def who_is_missing(file_name):
- opened_file = open(file_name, "r")
- file = opened_file.read()
- list = file.split(',')
- max = '0'
- for k in list:
- if k > max:
- max = k
- for i in range (1, int(max) + 1):
- if str(i) not in list and str(i) > '0' and str(i) < str(max):
- opened_file.close()
- file = open(file_name, "r+")
- num = str(i)
- file.write(num)
- return i
- def main():
- pass
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement