You will write a program that indexes the powder pattern of a cubic crystal from a list of values.
The idea. For each line, is proportional to . Divide every by the first, then try the factors 1, 2 and 3. The right factor turns all the ratios into whole numbers. The whole numbers name the lattice: simple cubic starts , bcc and fcc . The edge is .
Your tasks.
sin2(two_theta) so that it returns .whole_numbers(angles) so that it returns the list of whole numbers for the first factor (1, 2 or 3) that makes every ratio within 0.05 of a whole number.lattice(sums) so that it returns "fcc", "bcc" or "sc" from the first two sums.edge(two_theta, s, wavelength).Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…