# You must make sure to run all cells in sequence using shift + enter or you might encounter errors
from pykubegrader.initialize import initialize_assignment
responses = initialize_assignment("8_lists_and_tuples_q", "week_2", "readings", assignment_points = 11.0, assignment_tag = 'week2-readings')
# Initialize Otter
import otter
grader = otter.Notebook("8_lists_and_tuples_q.ipynb")
โ ๐ฌ Materials Design: Lists and Tuples#
[Unk23]
# Run this block of code by pressing Shift + Enter to display the question
from questions._8_lists_and_tuples_q import Question1
Question1().show()
# Run this block of code by pressing Shift + Enter to display the question
from questions._8_lists_and_tuples_q import Question2
Question2().show()
# Run this block of code by pressing Shift + Enter to display the question
from questions._8_lists_and_tuples_q import Question3
Question3().show()
Materials Processing Sequence ๐ญ#
Instructions:#
Create the following variables:
element_properties
: A tuple storing properties of titanium (โTiโ, 22, 47.87)processing_steps
: A list storing heat treatment steps [โSolution Treatmentโ, โQuenchingโ, โAgingโ]temperatures
: A list of processing temperatures [955, 25, 540]times
: A list of processing times in hours [1.0, 0.1, 24.0]total_time
: Use sum() to calculate total processing timemax_temp
: Use max() to find the highest temperaturenum_steps
: Calculate the number of processing steps using len()process_complete
: A boolean indicating if all steps are completed (True)
Print a descriptive message that incorporates all the above variables, formatted like this:
Processing Ti (Atomic number: 22, Mass: 47.87) using 3 steps: Solution Treatment at 955ยฐC for 1.0 hours Quenching at 25ยฐC for 0.1 hours Aging at 540ยฐC for 24.0 hours Total processing time: 25.1 hours Maximum temperature: 955ยฐC Process completion status: True
def materials_processing():
# Define the variables
element_properties = ...
processing_steps = ...
temperatures = ...
times = ...
total_time = ...
max_temp = ...
num_steps = ...
process_complete = ...
return (
element_properties,
processing_steps,
temperatures,
times,
total_time,
max_temp,
num_steps,
process_complete,
)
# This code is provided for you to test the function to ensure it is correct
# please do not modify the provided code
# Get all variables
(
element_properties,
processing_steps,
temperatures,
times,
total_time,
max_temp,
num_steps,
process_complete,
) = materials_processing()
# Print the descriptive message
print(f"Processing {element_properties[0]} (Atomic number: {element_properties[1]}, Mass: {element_properties[2]}) using {num_steps} steps:")
for step, temp, time in zip(processing_steps, temperatures, times):
print(f"{step} at {temp}ยฐC for {time} hours")
print(f"Total processing time: {total_time} hours")
print(f"Maximum temperature: {max_temp}ยฐC")
print(f"Process completion status: {process_complete}")
grader.check("question-Materials-Processing-Sequence")
References#
Data-driven automated synthesis. https://www.nature.com/collections/ddbfdfhfbh, 8ย June 2023. Accessed: 2024-12-23.
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized Neural Networks: Training Deep Neural Networks with Weights and Activations Constrained to +1 or -1. ArXiv, 2016. URL: http://papers.neurips.cc/paper/6573-binarized-neural-networks.pdf.
Submitting Assignment#
Please run the following block of code using shift + enter
to submit your assignment, you should see your score.
from pykubegrader.submit.submit_assignment import submit_assignment
submit_assignment("week2-readings", "8_lists_and_tuples_q")