How to paste a code in colors?


#1

Hey all,

When I paste my code, it's just black. (Indentions are good :slightly_smiling:)
Some people paste their codes with colors... How do you do this here on the forum? (Without doing it by hand of course :wink: )

Sorry for wasting your time!

MatSn0w

Example:

# Write your function below!
def fizz_count(x):
    count = 0
    for item in x:
        if item == "fizz":
            count = count + 1
    return count

#2

Hey.. If you put it 3 double quotes around it.. Like this

```
Type in here
```

It will come out like this:

# Write your function below!
def fizz_count(x):
    count = 0
    for item in x:
        if item == "fizz":
            count = count + 1
    return count

#3

Thanks! This should be an option in the editor :smile:


#4

@matsn0w

It sort of is("</>" button in top of editor), although I don't think there are colors.
print("hello")
See?
Also, is that how you pasted code in the first post, or did you just did something like you would on a regular text editor?


#5

@zainabrawat
That works because of Markdown Syntax.


#6

Yeah, I used the </> button.