Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:57:10+00:00 2026-05-24T19:57:10+00:00

I have a question that may be straight forward, or may be impossible to

  • 0

I have a question that may be straight forward, or may be impossible to answer, I’m not sure. I’m wondering how I can define a color in python.

For example, I would like to simply do this:

myColor = #920310

However, using the ‘#’ sign in python automatically comments anything following.
Is there a way around this? Thank you and sorry if this question is very simple

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:57:11+00:00Added an answer on May 24, 2026 at 7:57 pm

    If you want it as a string, do

    myColor = '#920310'
    

    If you actually want it to be a Color object, you can do something like

    myColor = Color('#920310')
    

    and interpret it in Color‘s constructor.

    If the question is can you make # not be interpreted as a comment, then the answer is no. If # wasn’t a comment, it wouldn’t be Python any more.

    You could define your own, Python-like language where a # after an = wouldn’t mean a comment (since that’s not valid Python anyway) and it wouldn’t break any code, but you wouldn’t be able to use the # syntax elsewhere without breaking code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question may not directly relate to programming. I have noticed that the technology
This may be a relatively straight-forward question that I just haven't been searching for
Straight forward question :) I have a column that is stored as such in
I have a question that may be quite naive, but I feel the need
Question: I have a question that is apparently not answered by this already-asked Bash
A question that seems to have quite a few options for Python, but none
I have learned that builds should be very straight forward and requires less human
--EDIT-- I believe this is a valid question that may have multiple answers (as
This may be a really simple question, but I'm not sure what the most
I have a question that I just don't feel like I've found a satisfactory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.