Profile image of anonymous
Submitted by anonymous
almost 12 years

How do I enter indented code in a Codecademy's "Ask a question" box?

I’ve tried the little squiggly marks { } but that didn’t work. Can someone please explain:

  1. How I enter code into the “Ask a question” box
  2. How I enter code into the “Comment” box?

Thank you.

Answer 509bc71d6d816a0200003251

101 votes

Permalink

In the comments you can only put plain text, no formatting. But in the questions and answers it’s easy: before typing code, click the {} button above the editor window:

It’ll insert “backticks” (typing `this` produces this). If your code snippet spans across several lines (when you pasted it in from some exercise), select all lines of code, then click the {} button. That will insert four spaces at the beginning of each line.

Typing

⎵⎵⎵⎵print "hello"

(where ⎵ represents a whitespace) will produce:

print "hello"

You have to put a blank line before and after the indented lines.

Also see this document or this help article.

Profile image of anonymous
Submitted by anonymous
almost 12 years

4 comments

Profile image of anonymous
Submitted by anonymous
almost 12 years

Alex J: Thanks. No doubt you’re constantly improving Codecademy, but why don’t you include something like “About Codecademy” or a FAQ – both are pretty standard at websites – to enable people like me to find and learn the basics of how the website works. At this point it seems I am either forced to ask questions about each specific technical use issue or sift through endless comments, many of which are irrelevant. Or am I missing something? Also, why is the Comment box so tiny and why am I not allowed a preview?

Profile image of anonymous
Submitted by anonymous
over 11 years

agreed!

Profile image of anonymous
Submitted by anonymous
over 10 years

Yes. +1000 to this suggestion

Profile image of anonymous
Submitted by anonymous
over 10 years

FAQ pages exist: http://help.codecademy.com/customer/portal/articles/1421289 Moreover, formatting instructions are directly below the editing window when you submit a forum question: http://is.gd/D6Kd8F The trouble is that people who read all that are a very tiny minority.

Answer 5492016cd3292fcebe0032ce

7 votes

Permalink

Someone is just thumbs downing everyone… just to get their’s on top? Really? I never knew some people here are immature.

Profile image of anonymous
Submitted by anonymous
almost 10 years

2 comments

Profile image of anonymous
Submitted by anonymous
almost 10 years

Im just gunna thumbs up everone.

Profile image of anonymous
Submitted by anonymous
over 9 years

same

Answer 537a1fd17c82ca602100021d

2 votes

Permalink

Trying again…..

 console.log("Did I succeed?");
   console.log("I hope I did!");
   var strawberries = "Nom nom nom"

:D

Profile image of anonymous
Submitted by anonymous
over 10 years

Answer 53bb815f9c4e9d939a00002f

2 votes

Permalink

console.log("Hello")

for x in students:
    results.append(get_average(x))
return average(results)
def get_letter_grade(score):
if score >= 90:
    return "A"
elif score >= 80:
    return "B"
elif score >= 70:
    return "C"
elif score >= 60:
    return "D"
else:
    return "F"
console.log("I THINK I DID IT")
Profile image of anonymous
Submitted by anonymous
over 10 years

Answer 51a716dfcc3557569e00250f

1 vote

Permalink

"name": "Tyler"
Profile image of anonymous
Submitted by anonymous
over 11 years

Answer 517702005a80804f86000a5d

0 votes

Permalink

I’ve always wondered about this!

console.log('Awesome!')
Profile image of anonymous
Submitted by anonymous
over 11 years

Answer 51d545038c1ccc26dc006830

0 votes

Permalink

let me try

console.log("i understand");
Profile image of anonymous
Submitted by anonymous
over 11 years

Answer 51d5c742631fe98c4300d99e

0 votes

Permalink

console.log("I love programming!")
Profile image of anonymous
Submitted by anonymous
over 11 years

1 comments

Profile image of anonymous
Submitted by anonymous
over 9 years

I’ll say that in the future. lol

Answer 51ea27ee282ae3eca8001ea1

0 votes

Permalink

let me try

console.log("Ok but it's hard");
Profile image of anonymous
Submitted by anonymous
about 11 years

3 comments

Profile image of anonymous
Submitted by anonymous
about 11 years
console.log("You are fast learner and codecademy make us learn fast");
Profile image of anonymous
Submitted by anonymous
almost 11 years

Javascript

Profile image of anonymous
Submitted by anonymous
almost 11 years

This is python.

Answer 5372b9bf631fe9e1220004eb

0 votes

Permalink

console.log("My brains are melting.");

awesome. thanks!

Profile image of anonymous
Submitted by anonymous
over 10 years

Answer 5479c5ee631fe9ad8700298d

0 votes

Permalink

enter code here let me try!
Profile image of anonymous
Submitted by anonymous
almost 10 years

Answer 54917f72937676bf0b001c87

0 votes

Permalink

def lets_try():
    print 'kaboom'
Profile image of anonymous
Submitted by anonymous
almost 10 years

Answer 54c92de351b8873e91002662

0 votes

Permalink

def get_letter_grade(score):

print "Getting grade..."

if score >= 90:
    return "A"
elif score >= 80:
    return "B"
elif score >= 70:
    return "C"
elif score >= 60:
    return "D"
else:
    return "F"

print get_letter_grade(get_average(lloyd)) def get_letter_grade(score):

print "Getting grade..."

if score >= 90:
    return "A"
elif score >= 80:
    return "B"
elif score >= 70:
    return "C"
elif score >= 60:
    return "D"
else:
    return "F"

print get_letter_grade(get_average(lloyd))

Profile image of anonymous
Submitted by anonymous
over 9 years

Answer 55621106e39efec6ac0004ce

0 votes

Permalink

i just replace the blank space with a > symbol and its showed indented…

Profile image of anonymous
Submitted by anonymous
over 9 years

Answer 535bdc4d9c4e9dda80000187

-1 votes

Permalink

I’ll try:

blueberry_count = 345
Profile image of anonymous
Submitted by anonymous
over 10 years

1 comments

Profile image of anonymous
Submitted by anonymous
over 10 years

random! :D

Answer 54acb4eb86f552811c0034d0

-1 votes

Permalink

testing

console.log("why did I not learn this before?");
Profile image of anonymous
Submitted by anonymous
almost 10 years

Answer 54c92dcd9113cb9e240025b8

-1 votes

Permalink

def get_letter_grade(score):

print "Getting grade..."

if score >= 90:
    return "A"
elif score >= 80:
    return "B"
elif score >= 70:
    return "C"
elif score >= 60:
    return "D"
else:
    return "F"

print get_letter_grade(get_average(lloyd))

Profile image of anonymous
Submitted by anonymous
over 9 years

1 comments

Profile image of anonymous
Submitted by anonymous
over 9 years

def get_letter_grade(score):

print "Getting grade..."

if score >= 90:
    return "A"
elif score >= 80:
    return "B"
elif score >= 70:
    return "C"
elif score >= 60:
    return "D"
else:
    return "F"

print get_letter_grade(get_average(lloyd))

Answer 540368bd9c4e9d3a48001af9

-3 votes

Permalink

console.log("wonderful!");
Profile image of anonymous
Submitted by anonymous
about 10 years

Answer 517946df957cf00b1c0033a1

-4 votes

Permalink

console.log('Okay')
Profile image of anonymous
Submitted by anonymous
over 11 years

Answer 53ea049252f863b89c001a50

-6 votes

Permalink

console.log("I love codeacademy!");
Profile image of anonymous
Submitted by anonymous
about 10 years