Intermediate Python Coding Task
Budget: €30 – €250 EUR
I'm in need of a skilled Python programmer to assist with an intermediate level coding task. The task is a university project due tomorrow, and it involves working with data structures and file operations.
Key Requirements:
- Proficient in Python: You should have a strong grasp of Python programming, particularly its data structures and file handling capabilities.
- Experience with Intermediate-Level Programming: The task requires someone with experience handling tasks that go beyond basic calculations.
- Ability to Work Under Time Pressure: This task has a tight deadline as it's due tomorrow, so you need to be able to work efficiently without compromising quality.
My task is: Create a stack.py library that implements a stack via a linked list. Only positive numbers in the range of the number of bytes that will be entered when creating the stack will be able to be stored in the stack. The stack will be able to be saved to and loaded from a binary file. The binary will be in the given format - the first byte will be the range of numbers to store, followed by the numbers themselves stored on the stack. Save and load the file according to convert_number_to_bytes(x, count_byte), write_number(file, count_byte, number), convert_bytes_to_number(bytes), precision_number(file).
It will be possible to create any number of stacks. It will be possible to freely add and obtain elements to the stacks. Attempting to remove from an empty stack will return None. Only simple Python constructs can be used. Among other things therefore, the use of an additional library, an unread data structure (dictionary, tuple) is not allowed. Furthermore, the use of global variables is not allowed. It is not allowed to use functions for working with lists (e.g. pop() and clear()) for the actual manipulation of data in the stack (i.e. adding to the stack, removing from the stack), for auxiliary functions for conversion and saving to a file the use is these features enabled. Hint: To preserve the link to the stack, the stack itself can be "wrapped" with a list. Example of use:
z1 = stack.create_stack(2)
tray.add_to_tray(z1, 16)
tray.add_to_tray(z1, 65536)
tray.add_to_tray(z1, 65535)
tray.add_to_tray(z1, 3)
tray.add_to_tray(z1, -3)
tray.write_to_file("tray.bin", z1)
z2 = tray.create_from_file("tray.bin")
print(tray.remove_from_tray(z2))
print(tray.remove_from_tray(z2))
print(tray.remove_from_tray(z2))
Writes:
the value 65536 is outside the allowed range.
a value of -3 is outside the allowed range.
3
65535
16
I can only write code in the way I learned at university, here I am sending the site, it is in Czech, but you will see the code and understand what I mean: https://www.inf.upol.cz/lide/karel-panchartek/vyuka/zaklady-programovani-pro-it-2
Key Requirements:
- Proficient in Python: You should have a strong grasp of Python programming, particularly its data structures and file handling capabilities.
- Experience with Intermediate-Level Programming: The task requires someone with experience handling tasks that go beyond basic calculations.
- Ability to Work Under Time Pressure: This task has a tight deadline as it's due tomorrow, so you need to be able to work efficiently without compromising quality.
My task is: Create a stack.py library that implements a stack via a linked list. Only positive numbers in the range of the number of bytes that will be entered when creating the stack will be able to be stored in the stack. The stack will be able to be saved to and loaded from a binary file. The binary will be in the given format - the first byte will be the range of numbers to store, followed by the numbers themselves stored on the stack. Save and load the file according to convert_number_to_bytes(x, count_byte), write_number(file, count_byte, number), convert_bytes_to_number(bytes), precision_number(file).
It will be possible to create any number of stacks. It will be possible to freely add and obtain elements to the stacks. Attempting to remove from an empty stack will return None. Only simple Python constructs can be used. Among other things therefore, the use of an additional library, an unread data structure (dictionary, tuple) is not allowed. Furthermore, the use of global variables is not allowed. It is not allowed to use functions for working with lists (e.g. pop() and clear()) for the actual manipulation of data in the stack (i.e. adding to the stack, removing from the stack), for auxiliary functions for conversion and saving to a file the use is these features enabled. Hint: To preserve the link to the stack, the stack itself can be "wrapped" with a list. Example of use:
z1 = stack.create_stack(2)
tray.add_to_tray(z1, 16)
tray.add_to_tray(z1, 65536)
tray.add_to_tray(z1, 65535)
tray.add_to_tray(z1, 3)
tray.add_to_tray(z1, -3)
tray.write_to_file("tray.bin", z1)
z2 = tray.create_from_file("tray.bin")
print(tray.remove_from_tray(z2))
print(tray.remove_from_tray(z2))
print(tray.remove_from_tray(z2))
Writes:
the value 65536 is outside the allowed range.
a value of -3 is outside the allowed range.
3
65535
16
I can only write code in the way I learned at university, here I am sending the site, it is in Czech, but you will see the code and understand what I mean: https://www.inf.upol.cz/lide/karel-panchartek/vyuka/zaklady-programovani-pro-it-2