Ark1002

Code Function

4 posts in this topic

So, as you may or may not know, there's a little button labeled code up at the top, looking like the less than sign and the greater than sign by each other.

When you type in it, it looks like this

djkdkjab

Supposedly, you can use it to code... something. It has an option for python, so I was messing around with it to see if I could figure it out.

I wrote something like this

name = input("What is your name? ")
print("Hello " + name + "!")

This would get input (ex: Ark) , then say Hello Ark!

It didn't work. I just assumed it didn't work because I couldn't get input on this.

So I tried something really simple

print("Hello")

This should just say the word Hello, very simple, very easy.

But nothing happened.

So could someone explain to me what the Code option actually does? I know it's doing something, as it color codes the parts of the script, just like a real coding website would do. Does it just not actually support Python? Am I just doing something wrong? Have I missed something?

Thanks in advance.

-Ark

0

Share this post


Link to post
Share on other sites

Like the other buttons around it, the Code option is a formatting option. It sets the text apart and formats it to look like code. Specifically, it maintains whitespacing and indentation and uses a monospaced font (and highlights the text if you select the language it is from). It's useful if you want to share code on the forums or if spacing is important, but it doesn't compile or run the code at all.

0

Share this post


Link to post
Share on other sites

luckat is correct. It's for sharing code so it appears formatted correctly. No code runs on the editor; that'd be super dangerous for any website to do.

0

Share this post


Link to post
Share on other sites

thanks! The code function did seem weird, but that makes a lot more sense.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.