Upload your solution as a .py file. Write a Python program (…
Upload your solution as a .py file. Write a Python program (no need to write any function) that creates two dictionaries containing the following information: Contents of the dictionary named ’employees’: Key (as string) Value (as string) Fox Mulder XF001 Dana Scully XF002 Contents of the dictionary named ‘annual_evaluations’: Key (as string) Value (as tuple of integers) XF001 (4, 2, 5, 1) XF002 (10, 10, 8, 8) You will then prompt the user to enter the name of an employee and display either “Employee not found” if that employee’s name is not in the list of keys from the dictionary named “employees”, or display the average of the annual evaluations that the corresponding employee earned (with one digit after the decimal dot). Sample program execution (user input is in red): Enter the name of an employee: Dana ScullyDana Scully has an average annual evaluation of 9.0 Grading Rubric 1 point for both dictionaries being correctly created and filled with the exact above data 1 point for finding the annual evaluations for a given name and computing that employee’s average 0.25 point for displaying the above-mentioned error message if the employee is not found 0.75 point for displaying prompt(s) and message(s) exactly as in the sample program execution example
Read DetailsUpload your solution as a .py file. Write a Python program (…
Upload your solution as a .py file. Write a Python program (no need to write any function) that creates a named tuple defined as follows: The name of the variable holding the named tuple object is Song, the name of the named tuple is also Song The name of the fields inside the named tuple are (in order) the names in the column headers of the table below You will then create one object of that named tuple data type per row of the following table title artist duration track Take my hand L. Skywalker 2.59 5 Lil short for a stormtrooper L.A. Skywalker 3.22 3 Mesa Senator J.J. Binks 1.56 9 You will then display the information about each of these objects on the screen. Sample Program Execution (no user input): Song(title=’Take my hand’, artist=’L. Skywalker’, duration=2.59, track=5)Song(title=’Lil short for a stormtrooper’, artist=’L.A. Skywalker’, duration=3.22, track=3)Song(title=’Mesa Senator’, artist=’J.J. Binks’, duration=1.56, track=9) Grading Rubric 1 point for defining the named tuple 1.5 points for creating the three named tuples objects 1.5 points for displaying the three named tuples as illustrated above
Read DetailsUpload your solution as a .py file. Write a Python program (…
Upload your solution as a .py file. Write a Python program (no need to write any function) that creates two dictionaries containing the following information: Contents of the dictionary named ’employees’: Key (as string) Value (as string) Pete Lattimer WH13002 Myka Bering WH13003 Contents of the dictionary named ‘annual_evaluations’: Key (as string) Value (as list of integers) WH13002 [7, 8, 5, 9] WH13003 [9, 8, 9, 10] You will then prompt the user to enter the name of an employee and display either “Employee not found” if that employee’s name is not in the list of keys from the dictionary named “employees”, or display the average of the annual evaluations that the corresponding employee earned (with one digit after the decimal dot). Sample program execution (user input is in red): Enter the name of a student: Myka BeringMika Bering has an average annual evaluation of 9.0 Grading Rubric 1 point for both dictionaries being correctly created and filled with the exact above data 1 point for finding the annual evaluations for a given name and computing that employee’s average 0.25 point for displaying the above-mentioned error message if the employee is not found 0.75 point for displaying prompt(s) and message(s) exactly as in the sample program execution example
Read DetailsUpload your solution as a .py file. Write a Python program (…
Upload your solution as a .py file. Write a Python program (no need to write any function) that creates two dictionaries containing the following information: Contents of the dictionary named ‘students’: Key (as string) Value (as string) Artie Nielsen U15232 Hubert Farnsworth U3024 Contents of the dictionary named ‘grades’: Key (as string) Value (as tuple of integers) U3024 (5, 85, 94, 25) U15232 (67, 75, 88, 90) You will then prompt the user to enter the name of a student and display either “Student not found” if that student’s name is not in the list of keys from the dictionary named “students”, or display the average of the grades that the corresponding student earned (with one digit after the decimal dot). Sample program execution (user input is in red): Enter the name of a student: Artie NielsenArtie Nielsen has an average grade of 80.0 Grading Rubric 1 point for both dictionaries being correctly created and filled with the exact above data 1 point for finding the grades for a given name and computing that student’s average 0.25 point for displaying the above-mentioned error message if the student is not found 0.75 point for displaying prompt(s) and message(s) exactly as in the sample program execution example
Read Details