This forum is now read-only. Please use our new forums! Go to forums

0 points
over 11 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.

points
Submitted by Alex J
over 11 years

4 comments

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?

M P over 10 years

agreed!

One Who about 10 years

Yes. +1000 to this suggestion

Alex J about 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.

points
over 9 years

2 comments

Eddy_Code_Basket_FTW over 9 years

Im just gunna thumbs up everone.

Jake Sanders about 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

points
Submitted by miphiibunny
almost 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")
points
over 9 years

Answer 51a716dfcc3557569e00250f

1 vote

Permalink

"name": "Tyler"
points
Submitted by Abhinav Anand
almost 11 years

Answer 517702005a80804f86000a5d

0 votes

Permalink

I’ve always wondered about this!

console.log('Awesome!')
points
Submitted by Luigi Vincent
almost 11 years

Answer 51d545038c1ccc26dc006830

0 votes

Permalink

let me try

console.log("i understand");
points
Submitted by Jing
over 10 years

Answer 51d5c742631fe98c4300d99e

0 votes

Permalink

console.log("I love programming!")
points
Submitted by Hassan Awan
over 10 years

1 comments

I’ll say that in the future. lol

Answer 51ea27ee282ae3eca8001ea1

0 votes

Permalink

let me try

console.log("Ok but it's hard");
points
Submitted by 史路隽
over 10 years

3 comments

Shirshak Bajgain over 10 years
console.log("You are fast learner and codecademy make us learn fast");
Omar Zaffar Khan over 10 years

Javascript

Mohsin Abro over 10 years

This is python.

Answer 5372b9bf631fe9e1220004eb

0 votes

Permalink

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

awesome. thanks!

points
Submitted by Orchid29
almost 10 years

Answer 5479c5ee631fe9ad8700298d

0 votes

Permalink

enter code here let me try!
points
Submitted by Zhuzhu880618
over 9 years

Answer 54917f72937676bf0b001c87

0 votes

Permalink

def lets_try():
    print 'kaboom'
points
Submitted by helloCole11
over 9 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))

points
Submitted by PhillyDilly
about 9 years

Answer 55621106e39efec6ac0004ce

0 votes

Permalink

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

points
Submitted by Santiago_77
almost 9 years

Answer 535bdc4d9c4e9dda80000187

-1 votes

Permalink

I’ll try:

blueberry_count = 345
points
Submitted by miphiibunny
almost 10 years

1 comments

miphiibunny almost 10 years

random! :D

Answer 54acb4eb86f552811c0034d0

-1 votes

Permalink

testing

console.log("why did I not learn this before?");
points
Submitted by fiatluxury
about 9 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))

points
Submitted by PhillyDilly
about 9 years

1 comments

PhillyDilly about 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!");
points
Submitted by Sana Maqsood
over 9 years

Answer 517946df957cf00b1c0033a1

-4 votes

Permalink

console.log('Okay')
points
Submitted by Ralph Schreurs
almost 11 years

Answer 53ea049252f863b89c001a50

-6 votes

Permalink

console.log("I love codeacademy!");
points
Submitted by Cristina Stafie
over 9 years