Question 3 - (this question MAY appear on the assignment quiz) Write a Python program to solve the following problem: Given a two-dimensional list/table containing hexadecimal colour codes representing a picture, write functions to look for the corresponding colour names in another two-dimensional colour lookup table (see below) and generate a resulting two-dimensional table containing the names of the colours in the appropriate locations, corresponding to where the colour code was in the original hexadecimal table. See sample expected output below. Call the file containing your program, colour_codes.py. Include the following functions in your code: • a function to find the appropriate row, in the colour lookup table, corresponding to the first three digits of the colour code in the picture; the function should take, as parameters, the lookup table and a string containing the first three digits of the colour code and return the code's row location (e.g., partial code "FFO" would give 4 as a return value since it can be found in row 4 of the lookup table) • a function to find the appropriate column, in the colour lookup table, corresponding to the last three digits of the colour code in the picture; the function should take, as parameters, the lookup table and a string containing the last three digits of the colour code and return the code's column location (e.g., partial code "FO0" would give 3 as a return value since it can be found in column 3 of the lookup table) • a function to print the resulting table in the format shown in the sample expected output below • a main function to use the other functions to get the resulting "colour name" table and print it; the main function should contain the two given two-dimensional lists/tables as given below (colourLookup and sare encodedPic)
Question 3 - (this question MAY appear on the assignment quiz) Write a Python program to solve the following problem: Given a two-dimensional list/table containing hexadecimal colour codes representing a picture, write functions to look for the corresponding colour names in another two-dimensional colour lookup table (see below) and generate a resulting two-dimensional table containing the names of the colours in the appropriate locations, corresponding to where the colour code was in the original hexadecimal table. See sample expected output below. Call the file containing your program, colour_codes.py. Include the following functions in your code: • a function to find the appropriate row, in the colour lookup table, corresponding to the first three digits of the colour code in the picture; the function should take, as parameters, the lookup table and a string containing the first three digits of the colour code and return the code's row location (e.g., partial code "FFO" would give 4 as a return value since it can be found in row 4 of the lookup table) • a function to find the appropriate column, in the colour lookup table, corresponding to the last three digits of the colour code in the picture; the function should take, as parameters, the lookup table and a string containing the last three digits of the colour code and return the code's column location (e.g., partial code "FO0" would give 3 as a return value since it can be found in column 3 of the lookup table) • a function to print the resulting table in the format shown in the sample expected output below • a main function to use the other functions to get the resulting "colour name" table and print it; the main function should contain the two given two-dimensional lists/tables as given below (colourLookup and sare encodedPic)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY