Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SOUND FREQUENCY: Write a Python code using Visual Studio Code (VS Code). Write a program that takes a frequency and, optionally, a reference frequency for

SOUND FREQUENCY: Write a Python code using Visual Studio Code (VS Code).

Write a program that takes a frequency and, optionally, a reference frequency for A, and determines

the corresponding pitch and octave

the degree to which the frequency is out of tune, given the reference frequency

which species from a prioritized list can hear the frequency, if any

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

i have added the template for the problem pleas help to solve the problem. image text in transcribed 1.) frequency.py template

image text in transcribed 2.) test_frequency.py

image text in transcribed

image text in transcribed

Show transcribed image tex

Problem statement Write a program that takes a frequency and, optionally, a reference frequency for A, and determines the corresponding pitch and octave the degree to which the frequency is out of tune, given the reference frequency which species from a prioritized list can hear the frequency, if any . Instructions Using the provided template file, frequency.py, implement the following functions. The template imports some functionality from standard libraries, notably the log2() function for calculating logarithms of base 2. It includes a function, parse_args(). which processes command-line arguments, and an if name == "main": statement which runs the entire program. You will not need to edit the template code other than to remove the comments on lines 9-14. You will write your functions after the import statements and before the parse_args() function. get_pitch() function Write a function named get_pitch(). This function will determine the pitch of the specified frequency. Your function should take one required parameter (a frequency whose pitch you will determine) and one optional parameter (a value to use for the note A; use 440.0 as the default value for this parameter). Use the formula [12(1033 (4.) mod 1)] (where [x] means round x to the nearest integer, fis the frequency whose pitch you wish to determine, A is the value to use for the note A, and mod is the modulo operation). This formula will result in a number between 0 and 11, where the numbers correspond to the following notes: Number Pitch 0 A 1 At N B 3 4 CH 5 D 6 D 7 E 8 F 8 F 9 F# 10 G 11 G# Convert the result of the formula to a string (use the hash character # in place of the sharp sign #) and return the string. get_octave() function Write a function named get_octave(). This function will determine which octave the specified frequency belongs to, as an integer. For example, A belongs to octave 4. Your function should take one required parameter (a frequency whose octave you will determine) and one optional parameter (a value to use for the note A; use 440.0 as the default value for this parameter). Use the formula ||12(log2 (2))] +57 12 (where [x] means round x to the nearest integer, means use floor division to divide y by z, fis the frequency whose octave you wish to determine, and A is the value to use for the note A). Return the result of this calculation. check_intonation() function Write a function named check_intonation(). This function will determine how far out of tune the specfied frequency is, in cents, as an integer. A negative number will indicate that the specified frequency is flat; a positive number will indicate that the specified frequency is sharp; O will indicate that the specified frequency is in tune. Your function should take one required parameter (a frequency whose intonation you will analyze) and one optional parameter (a value to use for the note A; use 440.0 as the default value for this parameter). Use the formula [1200(109:( )) +50] | +50) mod 100 50 (where [x] means round x to the nearest integer, fis the frequency whose intonation you wish to analyze, A, is the value to use for the note A, and mod is the modulo operation). Return the result of this calculation. who_can_hear() function Write a function named who_can_hear(). This function will return a string indicating a species that can hear a particular frequency, or None if it is not aware of a species that can hear the specified frequency Your function should take one required parameter (a frequency). Here are the values the function should return, in order from highest to lowest priority: "human", for frequencies between 20 and 20,000 Hz, inclusive "pigeon", for frequencies below the range of human hearing down to 0.5 Hz, inclusive "dog", for frequencies above the range of human hearing up to 44,000 Hz, inclusive "cat", for frequencies above the range of dog hearing up to 77,000 Hz, inclusive "porpoise", for frequencies above the range of cat hearing up to 150,000 Hz, inclusive "greater wax moth", for frequencies above the range of porpoise hearing up to 300,000 Hz, inclusive None (note: this is not a string!) for all other frequencies main() function Write a function named main(). This function will invoke the other functions and display output to the user Your function should take one required parameter (a frequency to be analyzed) and one optional parameter (a value to use for the note A; use 440.0 as the default value for this parameter). Your function should raise a ValueError if the frequency to be analyzed is less than or equal to zero. Your function should print three lines to stdout. The first line should indicate the frequency, pitch, and octave. The second line should indicate the degree of intonation and the frequency used for A. The third line should indicate which species, if any, can hear the frequency. The strings printed by your function should match the examples shown below. Arguments: 554.5 (default A) 554.5 Hz is C#5. It is in tune if A4=440.0 Hz. It is within the hearing range of a human. Arguments: 49_000.0, A=432 49000.0 Hz is G11. It is 9 cents flat if A4=432.0 Hz. It is within the hearing range of a cat. Arguments: 0.25 (default A) 0.25 Hz is C-6. It is 38 cents flat if A4=440.0 Hz. I don't know of a species that can hear this frequency. Other instructions Please write docstrings for each of your functions. Your docstrings should start with a brief statement of the function's purpose. Include an "Args" section to document any arguments, and a "Returns" section to describe the return value (if any). Your main() function will not need a "Returns" section, but it should include a "Raises" section and a "Side effects" section (because printing is a side effect). Docstrings were Testing your code Running your program at the command line The template is designed to use command-line arguments. To run your program within the VS Code built-in terminal, first make sure you have opened (in VS Code) the directory where your program is saved. If necessary, you can go to the VS Code File menu and select "Open..." on macos or "Open Folder..." on Windows, and navigate to the directory where your program is. Then, open the VS Code built-in terminal. Type python3 (on macos) or python (on Windows) followed by a space, the name of the program, another space, and the frequency you wish to analyze. If you want to specify a different value for A than the default value, add another space, -a4, another space, and the value you wish to use for A. Below are some examples. python3 frequency.py 780.5 python3 frequency.py 18 -34 432 Test script A test script (test_frequency.py) is provided to help you test your code. In order to use the test suite, you will need to install Pytest. To do this, type the following at the command line (Windows users, type python instead of python3 ): 1 frequency.py test_frequency.py Homework > frequency-py > .. - Analyze a frequency and provide information about its pitch, octave, 2 intonation, and perceptibility." from argparse import ArgumentParser from math import log2 import sys 3 4 5 6 7 8 9 10 11 12 #Replace this comment with your implementation of the following functions: get_pitch() get_octave() check_intonation() who_can_hear() main() # # 23 # # 14 15 16 17 18 19 def parse_args(arglist): - Process command line arguments. Expect one mandatory argument (a frequency) and one optional argument, preceded by "-24" (the value to use as the frequency of A4). Args: arglist (list of str): arguments from the command line. 21 22 24 Returns namespaces the parsed arguments, as a namespace. 26 27 28 29 30 31 32 33 34 parser - ArgumentParser() parser.add_argument("freq", typesfloat, help a frequency in Hz") parser.add_argument("-", type-float, default 440.0, helpe' frequency to use for A4") args - parser.parse_argstarglist) return args 36 37 38 39 11 name="in" orgs - parse_args(sys.argv[1:1) salalargs.fred, deargs.64) Lt Colt frequency.py test_frequency.py x Homework > test_frequency.py > ... 1 # If your script has a name other than frequency.py, replace "frequency" on 2 # line 4 with the name of your script (without the py). 3 4 import frequency as fra 5 import pytest 6 7 def test_get_pitch(): 8 # test (near) canonical pitches with A4-440 9 assert frg.get_pitch(440.0) = "A" 10 assert frg-get_pitch(932.33) == "A" 11 assert frg.get_pitch(61.74) = "B" 12 assert frg.get_pitch(2893.0) - "C" 13 assert frg.get pitch(17.32) == "C" 14 assert frg-get_pitch( 4978.03) == "D" 15 assert frg.get_pitch(1318.51) == "E" 16 assert frg.get_pitch(174.61) = "F" 17 assert trg.get_pitch(369.99) == "F" 18 assert frg-get_pitch(98.e) = "G" 19 assert frg-get_pitch(3322.44) == " 20 21 #test some flat pitches 22 assert frg.get_pitch(1920) = "B" 23 assert frg-get_pitch(193) == "G" 24 25 # test some sharp pitches 26 assert frg-get_pitch(352) == "F" 27 assert trg.get pitch(18.7) = "D" 28 29 #run some tests with other values of A4 30 assert frg.get_Pitch(487.75, 432) == "69" 31 assert frg.get_pitch(12, 48) = "A" 32 33 det test_get_octave(): 34 test canonical pitches with A4-448 35 assert frg.get_octave(440.6) = 4 36 assert trg.get_octave(261.63) = 4 37 assert frg.get_octave (16.35) - 38 assert frg.get_octave (30.87) 39 assert trg.get_octave (2093) = 7 40 41 # test some edge cases 42 essert trg.get_octave(4865) - 7 43 assert trg.get_octave(4068) - 8 44 45 test than frequency.py test_frequency.py Homework > test_frequency.py .. 45 #test other values of A4 46 assert frg.get_octave (32.11, 432) = 1 47 assert trg.get_octave (30.31, 432) - 48 assert trg.get_octave (200, 100) = 5 49 50 def test_check_intonation(): 51 assert trg.check_intonation (293.66) - 52 assert trg.check_intonation (783.99) 53 assert trg.check_intonation (438.2245) = -7 54 assert frg.check_intonation (1783.5382) == 23 55 assert trg.check_intonation(266.3525) = 31 56 assert frg.check_intonation(761.7748, 432) == -18 57 58 def test_who_can_hear(): 59 assert frg.who_can_hear(300) == "human" 60 assert frg.who_can_hear(20) == "human" 61 assert trg.who_can_hear(20_000) == "human" 62 assert frg.who_can_hear(19.9) == "pigeon" 63 assert trg.who_can_hear(0.5) == "pigeon" 64 assert frg.who_can_hear(20_660.1) = "dog" 65 assert frg.who_can_hear(44_800) == "dog" 66 assert frg.who_can_hear(44_898.1) == "cat" assert firg.who_can_hear(77_000) == "cat" 68 assert trg.who_can_hear(77_008.1) = "porpoise" 69 assert frg.who_can_hear(150_000) == "porpoise" 70 assert firg.who_can_hear(150_000.1) == "greater wax moth" 71 assert frg.who_can_hear(380_800) == "seater wax moth" 72 assert frg.who_can_hear(308_008.1) == None 73 assert trg.who_can_hear(0.4) - None 74 75 def test main(capsys); 76 trg.main(440.6) 77 captured - capsys.readouterra) 78 assert captured out as ("440.0 Hz is A4. " 79 "It is in tune if A4=440. Hz. In'" 80 "It is within the hearing range of a hunan. In") 81 trg.main(25600.6) 82 captured - capsys.readouterr() B3 assert captured out - ("25680.0 Hz is G10.In" 84 "It is 35 cents sharp 17 A4=440. Hz. In" 85 "It is within the hearing range of a dog. ") 86 fr.main(0.17) captured capsys.readouterr() 88 assert captured.out - ("0.17 Hz is F-7.0" 89 "It is 5 cents flat if A4-440.0 Hz. " 67 87 in 1, Col1 S frequency.py test_frequency.py Homework > test_frequency.py > ... 51 assert frg.check_intonation (293.66) = 52 assert trg.check_intonation(783.99) = 53 assert frg.check_intonation(438.2245) = -7 54 assert frg.check_intonation(1783.5382) == 23 55 assert frg.check_intonation (266.3525) = 31 56 assert frg.check_intonation(761.7748, 432) = -18 57 58 def test_who_can_hear(): 59 assert frg.who_can_hear(300) = "human" 60 assert frg.who_can_hear(20) == "human" 61 assert trg.who_can_hear(20_880) == "human" 62 assert frg.who_can_hear(19.9) "pigeon" 63 assert frg.who_can_hear(0.5) "pigeon" 64 assert frg.who_can_hear(20_080.1) -- "dog" 65 assert frg.who_can_hear(44_000) == "dog" 66 assert frg.who_can_hear(44_000.1) == "cat" 67 assert trg.who_can_hear(77_000) == "cat" assert frg.who_can_hear(77_000.1) "porpoise" assert frg.who_can_hear(150_000) == "porpoise" 78 assert frg.who_can_hear(150_800.1) == "greater wax moth" 71 assert frg.who_can_hear(300_008) == "greater wax moth" 72 assert trg.who_can_hear(380_008.1) = None 73 assert trg.who_can_hear(0.4) = None 75 def test_main(capsys): 76 frg.main(440.6) 77 captured = capsys.readouterr() assert captured out == (-448.6Hz is a no 79 "It is in tune if A4-448.0 Hz. In" 81 trg.main(25600.0) "It is within the hearing range of a human. ") 82 captured - capsys.readouterr() assert captured.out - ("25600.0 Hz is Gie. " 84 85 "It is 35 cents sharp af A4-448. Hz. In" trg.main(e.17) "It is within the hearing range of a dog. ") captured - capsys.readouterr() 88 assert captured out - ("0.17 Hz is F-7. In" 89 "It is 5 cents flat if A4-440.0 Hz. In" "I don't know of a species that can hear" 92 68 69 74 78 80 83 TIT 86 87 98 91 " this frequency. ") Problem statement Write a program that takes a frequency and, optionally, a reference frequency for A, and determines the corresponding pitch and octave the degree to which the frequency is out of tune, given the reference frequency which species from a prioritized list can hear the frequency, if any . Instructions Using the provided template file, frequency.py, implement the following functions. The template imports some functionality from standard libraries, notably the log2() function for calculating logarithms of base 2. It includes a function, parse_args(). which processes command-line arguments, and an if name == "main": statement which runs the entire program. You will not need to edit the template code other than to remove the comments on lines 9-14. You will write your functions after the import statements and before the parse_args() function. get_pitch() function Write a function named get_pitch(). This function will determine the pitch of the specified frequency. Your function should take one required parameter (a frequency whose pitch you will determine) and one optional parameter (a value to use for the note A; use 440.0 as the default value for this parameter). Use the formula [12(1033 (4.) mod 1)] (where [x] means round x to the nearest integer, fis the frequency whose pitch you wish to determine, A is the value to use for the note A, and mod is the modulo operation). This formula will result in a number between 0 and 11, where the numbers correspond to the following notes: Number Pitch 0 A 1 At N B 3 4 CH 5 D 6 D 7 E 8 F 8 F 9 F# 10 G 11 G# Convert the result of the formula to a string (use the hash character # in place of the sharp sign #) and return the string. get_octave() function Write a function named get_octave(). This function will determine which octave the specified frequency belongs to, as an integer. For example, A belongs to octave 4. Your function should take one required parameter (a frequency whose octave you will determine) and one optional parameter (a value to use for the note A; use 440.0 as the default value for this parameter). Use the formula ||12(log2 (2))] +57 12 (where [x] means round x to the nearest integer, means use floor division to divide y by z, fis the frequency whose octave you wish to determine, and A is the value to use for the note A). Return the result of this calculation. check_intonation() function Write a function named check_intonation(). This function will determine how far out of tune the specfied frequency is, in cents, as an integer. A negative number will indicate that the specified frequency is flat; a positive number will indicate that the specified frequency is sharp; O will indicate that the specified frequency is in tune. Your function should take one required parameter (a frequency whose intonation you will analyze) and one optional parameter (a value to use for the note A; use 440.0 as the default value for this parameter). Use the formula [1200(109:( )) +50] | +50) mod 100 50 (where [x] means round x to the nearest integer, fis the frequency whose intonation you wish to analyze, A, is the value to use for the note A, and mod is the modulo operation). Return the result of this calculation. who_can_hear() function Write a function named who_can_hear(). This function will return a string indicating a species that can hear a particular frequency, or None if it is not aware of a species that can hear the specified frequency Your function should take one required parameter (a frequency). Here are the values the function should return, in order from highest to lowest priority: "human", for frequencies between 20 and 20,000 Hz, inclusive "pigeon", for frequencies below the range of human hearing down to 0.5 Hz, inclusive "dog", for frequencies above the range of human hearing up to 44,000 Hz, inclusive "cat", for frequencies above the range of dog hearing up to 77,000 Hz, inclusive "porpoise", for frequencies above the range of cat hearing up to 150,000 Hz, inclusive "greater wax moth", for frequencies above the range of porpoise hearing up to 300,000 Hz, inclusive None (note: this is not a string!) for all other frequencies main() function Write a function named main(). This function will invoke the other functions and display output to the user Your function should take one required parameter (a frequency to be analyzed) and one optional parameter (a value to use for the note A; use 440.0 as the default value for this parameter). Your function should raise a ValueError if the frequency to be analyzed is less than or equal to zero. Your function should print three lines to stdout. The first line should indicate the frequency, pitch, and octave. The second line should indicate the degree of intonation and the frequency used for A. The third line should indicate which species, if any, can hear the frequency. The strings printed by your function should match the examples shown below. Arguments: 554.5 (default A) 554.5 Hz is C#5. It is in tune if A4=440.0 Hz. It is within the hearing range of a human. Arguments: 49_000.0, A=432 49000.0 Hz is G11. It is 9 cents flat if A4=432.0 Hz. It is within the hearing range of a cat. Arguments: 0.25 (default A) 0.25 Hz is C-6. It is 38 cents flat if A4=440.0 Hz. I don't know of a species that can hear this frequency. Other instructions Please write docstrings for each of your functions. Your docstrings should start with a brief statement of the function's purpose. Include an "Args" section to document any arguments, and a "Returns" section to describe the return value (if any). Your main() function will not need a "Returns" section, but it should include a "Raises" section and a "Side effects" section (because printing is a side effect). Docstrings were Testing your code Running your program at the command line The template is designed to use command-line arguments. To run your program within the VS Code built-in terminal, first make sure you have opened (in VS Code) the directory where your program is saved. If necessary, you can go to the VS Code File menu and select "Open..." on macos or "Open Folder..." on Windows, and navigate to the directory where your program is. Then, open the VS Code built-in terminal. Type python3 (on macos) or python (on Windows) followed by a space, the name of the program, another space, and the frequency you wish to analyze. If you want to specify a different value for A than the default value, add another space, -a4, another space, and the value you wish to use for A. Below are some examples. python3 frequency.py 780.5 python3 frequency.py 18 -34 432 Test script A test script (test_frequency.py) is provided to help you test your code. In order to use the test suite, you will need to install Pytest. To do this, type the following at the command line (Windows users, type python instead of python3 ): 1 frequency.py test_frequency.py Homework > frequency-py > .. - Analyze a frequency and provide information about its pitch, octave, 2 intonation, and perceptibility." from argparse import ArgumentParser from math import log2 import sys 3 4 5 6 7 8 9 10 11 12 #Replace this comment with your implementation of the following functions: get_pitch() get_octave() check_intonation() who_can_hear() main() # # 23 # # 14 15 16 17 18 19 def parse_args(arglist): - Process command line arguments. Expect one mandatory argument (a frequency) and one optional argument, preceded by "-24" (the value to use as the frequency of A4). Args: arglist (list of str): arguments from the command line. 21 22 24 Returns namespaces the parsed arguments, as a namespace. 26 27 28 29 30 31 32 33 34 parser - ArgumentParser() parser.add_argument("freq", typesfloat, help a frequency in Hz") parser.add_argument("-", type-float, default 440.0, helpe' frequency to use for A4") args - parser.parse_argstarglist) return args 36 37 38 39 11 name="in" orgs - parse_args(sys.argv[1:1) salalargs.fred, deargs.64) Lt Colt frequency.py test_frequency.py x Homework > test_frequency.py > ... 1 # If your script has a name other than frequency.py, replace "frequency" on 2 # line 4 with the name of your script (without the py). 3 4 import frequency as fra 5 import pytest 6 7 def test_get_pitch(): 8 # test (near) canonical pitches with A4-440 9 assert frg.get_pitch(440.0) = "A" 10 assert frg-get_pitch(932.33) == "A" 11 assert frg.get_pitch(61.74) = "B" 12 assert frg.get_pitch(2893.0) - "C" 13 assert frg.get pitch(17.32) == "C" 14 assert frg-get_pitch( 4978.03) == "D" 15 assert frg.get_pitch(1318.51) == "E" 16 assert frg.get_pitch(174.61) = "F" 17 assert trg.get_pitch(369.99) == "F" 18 assert frg-get_pitch(98.e) = "G" 19 assert frg-get_pitch(3322.44) == " 20 21 #test some flat pitches 22 assert frg.get_pitch(1920) = "B" 23 assert frg-get_pitch(193) == "G" 24 25 # test some sharp pitches 26 assert frg-get_pitch(352) == "F" 27 assert trg.get pitch(18.7) = "D" 28 29 #run some tests with other values of A4 30 assert frg.get_Pitch(487.75, 432) == "69" 31 assert frg.get_pitch(12, 48) = "A" 32 33 det test_get_octave(): 34 test canonical pitches with A4-448 35 assert frg.get_octave(440.6) = 4 36 assert trg.get_octave(261.63) = 4 37 assert frg.get_octave (16.35) - 38 assert frg.get_octave (30.87) 39 assert trg.get_octave (2093) = 7 40 41 # test some edge cases 42 essert trg.get_octave(4865) - 7 43 assert trg.get_octave(4068) - 8 44 45 test than frequency.py test_frequency.py Homework > test_frequency.py .. 45 #test other values of A4 46 assert frg.get_octave (32.11, 432) = 1 47 assert trg.get_octave (30.31, 432) - 48 assert trg.get_octave (200, 100) = 5 49 50 def test_check_intonation(): 51 assert trg.check_intonation (293.66) - 52 assert trg.check_intonation (783.99) 53 assert trg.check_intonation (438.2245) = -7 54 assert frg.check_intonation (1783.5382) == 23 55 assert trg.check_intonation(266.3525) = 31 56 assert frg.check_intonation(761.7748, 432) == -18 57 58 def test_who_can_hear(): 59 assert frg.who_can_hear(300) == "human" 60 assert frg.who_can_hear(20) == "human" 61 assert trg.who_can_hear(20_000) == "human" 62 assert frg.who_can_hear(19.9) == "pigeon" 63 assert trg.who_can_hear(0.5) == "pigeon" 64 assert frg.who_can_hear(20_660.1) = "dog" 65 assert frg.who_can_hear(44_800) == "dog" 66 assert frg.who_can_hear(44_898.1) == "cat" assert firg.who_can_hear(77_000) == "cat" 68 assert trg.who_can_hear(77_008.1) = "porpoise" 69 assert frg.who_can_hear(150_000) == "porpoise" 70 assert firg.who_can_hear(150_000.1) == "greater wax moth" 71 assert frg.who_can_hear(380_800) == "seater wax moth" 72 assert frg.who_can_hear(308_008.1) == None 73 assert trg.who_can_hear(0.4) - None 74 75 def test main(capsys); 76 trg.main(440.6) 77 captured - capsys.readouterra) 78 assert captured out as ("440.0 Hz is A4. " 79 "It is in tune if A4=440. Hz. In'" 80 "It is within the hearing range of a hunan. In") 81 trg.main(25600.6) 82 captured - capsys.readouterr() B3 assert captured out - ("25680.0 Hz is G10.In" 84 "It is 35 cents sharp 17 A4=440. Hz. In" 85 "It is within the hearing range of a dog. ") 86 fr.main(0.17) captured capsys.readouterr() 88 assert captured.out - ("0.17 Hz is F-7.0" 89 "It is 5 cents flat if A4-440.0 Hz. " 67 87 in 1, Col1 S frequency.py test_frequency.py Homework > test_frequency.py > ... 51 assert frg.check_intonation (293.66) = 52 assert trg.check_intonation(783.99) = 53 assert frg.check_intonation(438.2245) = -7 54 assert frg.check_intonation(1783.5382) == 23 55 assert frg.check_intonation (266.3525) = 31 56 assert frg.check_intonation(761.7748, 432) = -18 57 58 def test_who_can_hear(): 59 assert frg.who_can_hear(300) = "human" 60 assert frg.who_can_hear(20) == "human" 61 assert trg.who_can_hear(20_880) == "human" 62 assert frg.who_can_hear(19.9) "pigeon" 63 assert frg.who_can_hear(0.5) "pigeon" 64 assert frg.who_can_hear(20_080.1) -- "dog" 65 assert frg.who_can_hear(44_000) == "dog" 66 assert frg.who_can_hear(44_000.1) == "cat" 67 assert trg.who_can_hear(77_000) == "cat" assert frg.who_can_hear(77_000.1) "porpoise" assert frg.who_can_hear(150_000) == "porpoise" 78 assert frg.who_can_hear(150_800.1) == "greater wax moth" 71 assert frg.who_can_hear(300_008) == "greater wax moth" 72 assert trg.who_can_hear(380_008.1) = None 73 assert trg.who_can_hear(0.4) = None 75 def test_main(capsys): 76 frg.main(440.6) 77 captured = capsys.readouterr() assert captured out == (-448.6Hz is a no 79 "It is in tune if A4-448.0 Hz. In" 81 trg.main(25600.0) "It is within the hearing range of a human. ") 82 captured - capsys.readouterr() assert captured.out - ("25600.0 Hz is Gie. " 84 85 "It is 35 cents sharp af A4-448. Hz. In" trg.main(e.17) "It is within the hearing range of a dog. ") captured - capsys.readouterr() 88 assert captured out - ("0.17 Hz is F-7. In" 89 "It is 5 cents flat if A4-440.0 Hz. In" "I don't know of a species that can hear" 92 68 69 74 78 80 83 TIT 86 87 98 91 " this frequency. ")

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Apache Cassandra 3 X An Expert Guide To Improving Database Scalability And Availability Without Compromising Performance

Authors: Aaron Ploetz ,Tejaswi Malepati ,Nishant Neeraj

3rd Edition

1789131499, 978-1789131499

More Books

Students also viewed these Databases questions

Question

1. Does your voice project confidence? Authority?

Answered: 1 week ago