Delete Icon
This forum is now read-only. Please use our new forums at discuss.codecademy.com.
0 points
8 years ago

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:

alt

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.

3117 points
Submitted by Alex J
8 years ago

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 7 years ago

agreed!

One Who 7 years ago

Yes. +1000 to this suggestion

Alex J 7 years ago

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.

793 points
6 years ago

2 comments

Im just gunna thumbs up everone.

Jake Sanders 6 years ago

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

1027 points
Submitted by miphiibunny
6 years ago

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")
793 points
6 years ago

Answer 51a716dfcc3557569e00250f

1 vote

Permalink

"name": "Tyler"
162 points
Submitted by Abhinav Anand
7 years ago

Answer 517702005a80804f86000a5d

0 votes

Permalink

I’ve always wondered about this!

console.log('Awesome!')
809 points
Submitted by Luigi Vincent
7 years ago

Answer 51d545038c1ccc26dc006830

0 votes

Permalink

let me try

console.log("i understand");
937 points
Submitted by Jing
7 years ago

Answer 51d5c742631fe98c4300d99e

0 votes

Permalink

console.log("I love programming!")
1265 points
Submitted by Hassan Awan
7 years ago

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");
757 points
Submitted by 史路隽
7 years ago

3 comments

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

Javascript

Mohsin Abro 7 years ago

This is python.

Answer 5372b9bf631fe9e1220004eb

0 votes

Permalink

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

awesome. thanks!

557 points
Submitted by Orchid29
6 years ago

Answer 5479c5ee631fe9ad8700298d

0 votes

Permalink

enter code here let me try!
360 points
Submitted by Zhuzhu880618
6 years ago

Answer 54917f72937676bf0b001c87

0 votes

Permalink

def lets_try():
    print 'kaboom'
220 points
Submitted by helloCole11
6 years ago

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))

190 points
Submitted by PhillyDilly
6 years ago

Answer 55621106e39efec6ac0004ce

0 votes

Permalink

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

254 points
Submitted by Santiago_77
5 years ago

Answer 535bdc4d9c4e9dda80000187

-1 votes

Permalink

I’ll try:

blueberry_count = 345
1027 points
Submitted by miphiibunny
6 years ago

1 comments

miphiibunny 6 years ago

random! :D

Answer 54acb4eb86f552811c0034d0

-1 votes

Permalink

testing

console.log("why did I not learn this before?");
57 points
Submitted by fiatluxury
6 years ago

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))

190 points
Submitted by PhillyDilly
6 years ago

1 comments

PhillyDilly 6 years ago

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!");
118 points
Submitted by Sana Maqsood
6 years ago

Answer 517946df957cf00b1c0033a1

-4 votes

Permalink

console.log('Okay')
1091 points
Submitted by Ralph Schreurs
7 years ago

Answer 53ea049252f863b89c001a50

-6 votes

Permalink

console.log("I love codeacademy!");
403 points
Submitted by Cristina Stafie
6 years ago