-4

Can anyone help me with this exercise in python?

ASK: Create a function that accepts three integers that represent the RGB values and outputs the hex-code representation.

SAMPLE 100 200 233

SAMPLE OUTPUT #64c8e9

Donato
  • 3
  • 1
  • Read [this](https://www.developintelligence.com/blog/2017/02/rgb-to-hex-understanding-the-major-web-color-codes/) please :) This will help you – Osman Durdag Sep 20 '20 at 07:40
  • 1
    Kindly do a little research before asking questions on Stackoverflow. – aryanveer Sep 20 '20 at 07:41
  • 3
    Does this answer your question? [Converting a RGB color tuple to a six digit code, in Python](https://stackoverflow.com/questions/3380726/converting-a-rgb-color-tuple-to-a-six-digit-code-in-python) – baduker Sep 20 '20 at 07:42

1 Answers1

0

Use the built-in format operator


print('#%02x%02x%02x' % (100,200,233))

will output #64c8e9

aahnik
  • 1,661
  • 1
  • 11
  • 29