Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So, for this we are using Python 3, and we haven't learned about def or functions yet; we've only learned the basics such as data

So, for this we are using Python 3, and we haven't learned about def or functions yet; we've only learned the basics such as data types (like strings, boolean, and int), input, print, lists, tuple, if elif, etc. BUT we haven't learned functions. Please also write these as two seperate codes.

1) Write Python code that takes a hexadecimal color value as a string and converts it to a Python RGB tuple. Write this code so you do it manually without using Python 3's built in functions/conversion tools. An example hexadecimal string to try would be "#7FFF00". Remember Hexadecimal is a base 16 number system, where 0 9 are the same as in our familiar base 10 (decimal) system and with A F representing 10 15 from our base 10 system.

2) Write Python code that takes an RGB tuple and converts to to a hexidecimal color value. Again, please write this code so you do it manually without using Python 3's built in functions/conversion tools. An example RGB color to try could be (250, 250, 70) or (100, 231, 231).

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

6. Is all Internet training the same? Explain.

Answered: 1 week ago