### Instruction: You are a diligent grading assistant for a Computer Science teacher. Your task is to read and analyze the Python code between <code> and </code> tags. Evaluate the code according to the criteria provided between <criteria> and </criteria> tags. Before evaluating, carefully review the CodeDescription provided between <description> and </description> tags to understand the purpose and context of the project. For each criterion, always assess the logic of the code even if it does not run or contains errors, and provide a score. After addressing all criteria, conclude by listing all the individual scores in a summary. 

### CodeDescription: 
<description>
calculator that includes basic plus, mines, multiplicationalso built in the calculator will be sin cos tan to calculate degree and allow the python file to import the calculation record to the txt file.
</description>

### Criteria_1:
<criteria>
Description: Does the code contain branching statements and loops (as needed)? Branching using if-else and loops for repetitive execution of tasks are two of the most central elements of any Python code. So, all project code submissions must contain at least one if statement and one for / while statement.	
- 15 pts: Full points If the criteria is satisfied.
-10 pts: Partial points If the code contains only one of the two required components (if OR for/while)
-0 pts: No points
</criteria>

### Criteria_2:
<criteria>
Description: Does the Python code contain functions to create modular code? Functions are important to create modular tasks to reduce the redundancy in the code and for independent testing.	
- 10 pts: Full points If the code contains at least one function that is properly formatted and makes sense for the project.	
- 5 pts: Partial points If the code contains improper use of functions (or modular code is clear from files or other means).
- 0 pts: No points		
</criteria>

### Criteria_3:
<criteria>
Description: Data structures: Does the code use data structures as appropriate? Data structures discussed in the course are: strings, lists, and dictionaries. Grade whether the data structure that the code used is appropriate for that application. That is, if something has a key and a value, a dictionary is more appropriate than managing two lists. Similarly, if many variables are created instead of using a list, then it's improper code writing.
- 5 pts: Full points
- 0: pts No points
</criteria>

### Criteria_4:
<criteria>
Description: Does the code use files for reading or writing or any other advanced feature? If files are not applicable for the project, this criteria may be satisfied by graph generation, modules, python files, or other advanced features too.	
- 10 pts: Full points If file reading or other alternative advanced feature (like multiple modules, graphing, data analysis) is used appropriately in the code.
- 5 pts: Partial points Attempted to use files or other advanced feature but improper use/did not succeed fully.
- 0 pts: No points	
</criteria>

### Criteria_5:
<criteria>
Description: Is the code properly documented? Comments on key lines in the code and/or docstrings for functions.
- 5 pts: Full points if at least 5 commented lines or other text is present in the code
- 0 pts: No points If no comments or docstrings are provided.	
</criteria>

### Criteria_6:
<criteria>
Description: Did the code demonstrate most of the proposed features as written in the project ideas document? If most of the features are not demonstrated, check whether other equivalent (or new) features were implemented.	
- 25 pts: Full points If most of the features are successfully demonstrated (as seen from the code and its execution)
- 20 pts: Almost all features Almost all of the features for the project are demonstrated successfully.
- 15 pts: Half partial points Half of the proposed features are demonstrated successfully or some features are incorrectly implemented. The code implements a very basic set of features of the project.
- 10 pts: Partial points If only one feature is implemented and/or project is not significant work.
- 0 pts: No Marks
</criteria>

### Criteria_7:
<criteria>
Description: User-friendly interface Does the code create an interface for the user that is easy to use and friendly.	
- 10 pts: Full points
- 5 pts: Partial points If some user-messages are unhelpful
- 0 pts: No Marks
</criteria>

### MainPythonFileCode
<code>
import math
history = []
last_result = None
def get_number(prompt):
    if last_result is None:
        return float(input(prompt))
    else:
        choice = input('1. Use the last result as the first number (L)\n2. Enter a new number (N)\nEnter your choice (L/N): ')
        if choice in ['L', 'l']:
            return last_result
        elif choice in ['N', 'n']:
            return float(input(prompt))
        else:
            print('Invalid choice, so using the previous result.')
            return last_result
            
def add():
    num1 = get_number('Enter the first number: ')
    num2 = float(input('Enter the second number: '))
    result = num1 + num2
    history.append(result)
    return result
def subtract():
    num1 = get_number('Enter the first number: ')
    num2 = float(input('Enter the second number: '))
    result = num1 - num2
    history.append(result)
    return result
def multiply():
    num1 = get_number('Enter the first number: ')
    num2 = float(input('Enter the second number: '))
    result = num1 * num2
    history.append(result)
    return result
def divide():
    num1 = get_number('Enter the numerator: ')
    num2 = float(input('Enter the denominator: '))
    if num2 == 0:
        print('Error, denominator cannot be zero!!!')
        return None
    result = num1 / num2
    history.append(result)
    return result
def square_root():
    num = get_number('Enter the number: ')
    if num < 0:
        print('Error,cannot calculate square root with a negative number!!!')
        return None
    result = math.sqrt(num)
    history.append(result)
    return result
def sin():
    angle = get_number('Enter the angle in degrees: ')
    result = math.sin(math.radians(angle))
    history.append(result)
    return result
def cos():
    angle = get_number('Enter the angle in degrees: ')
    result = math.cos(math.radians(angle))
    history.append(result)
    return result
def tan():
    angle = get_number('Enter the angle in degrees: ')
    result = math.tan(math.radians(angle))
    history.append(result)
    return result
def view_history():
    print('The most recent three calculation results:')
    for idx, item in enumerate(history[-3:], start=1):
        print(f'{idx}. {item}')
def save_history():
    filename = input('Enter the filename to save the results,you can include the file format: ')
    with open(filename, 'w') as file:
        for item in history:
            file.write(str(item) + '\n')
    print(f'Results are saved to {filename}')
    
operations = {
    '1': add,
    '2': subtract,
    '3': multiply,
    '4': divide,
    '5': square_root,
    '6': sin,
    '7': cos,
    '8': tan,
    '9': view_history,
    '10': save_history
}

while True:
    print('Choose your calculating method:')
    for key, value in operations.items():
        print(f'{key}. {value.__name__}')
    print('11. exit')
    choice = input('Enter your option (1/2/3/4/5/6/7/8/9/10/11): ')
    if choice == '11':
        break
    elif choice in operations:
        operation = operations[choice]
        result = operation()
        if result is not None:
            last_result = result
            print('Result: ', result)
    else:
        print('Invalid, please re-enter!!')
</code>

### Response: