This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Student Becomes the Teacher Forum

View Course

926 points
09775d413cabbb91cba16290b1f36fc9?s=140&d=retro
Submitted by
JohnM
over 4 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.


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.

3114 points
1971df3750371cbdda4c08ad10b40030?s=140&d=retro
Submitted by
Alex J
over 4 years ago

4 Comments

09775d413cabbb91cba16290b1f36fc9?s=140&d=retro JohnM over 4 years ago

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?

E189f2b2bb1b3918f8290024fecfaaca?s=140&d=retro M P over 3 years ago

agreed!

E7fb86bc97300c3278c38b87107a08da?s=140&d=retro One Who about 3 years ago

Yes. +1000 to this suggestion

1971df3750371cbdda4c08ad10b40030?s=140&d=retro Alex J about 3 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.


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.

782 points
A80bdfd754f8072209f304d6e167343d?s=140&d=retro
Submitted by
Eddy_Code_Basket_FTW
over 2 years ago

2 Comments

A80bdfd754f8072209f304d6e167343d?s=140&d=retro Eddy_Code_Basket_FTW over 2 years ago

Im just gunna thumbs up everone.

547ef7b78c1ccc5c730019de_185010760 Jake Sanders about 2 years ago

same


2 votes

permalink

Trying again.....

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

:D

1027 points
Dacbca67435f014a00db9acfb446248e?s=140&d=retro
Submitted by
miphiibunny
almost 3 years ago


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

782 points
A80bdfd754f8072209f304d6e167343d?s=140&d=retro
Submitted by
Eddy_Code_Basket_FTW
over 2 years ago


1 vote

permalink

"name": "Tyler"

162 points
51877c464525107aa30036b6_600970660
Submitted by
Abhinav Anand
almost 4 years ago


0 votes

permalink

I've always wondered about this!

console.log('Awesome!')

809 points
51cba5f08c1cccb31f000bba_582871167
Submitted by
Luigi Vincent
almost 4 years ago


0 votes

permalink

let me try

console.log("i understand");

614 points
5147e011a4d32a51fb000c28_129700910
Submitted by
Jing
over 3 years ago


0 votes

permalink

console.log("I love programming!")

1265 points
51d295d4631fe99d830078be_650621566
Submitted by
Hassan Awan
over 3 years ago

1 Comment

17854eb7ba26f84bbbac9d0eeedb4abc?s=140&d=retro leandropaulino about 2 years ago

I'll say that in the future. lol


0 votes

permalink

let me try

console.log("Ok but it's hard");

757 points
51d6f5b9631fe992ba01db41_715231447
Submitted by
史路隽
over 3 years ago

3 Comments

D5c8ec83ef87548ceb4c13cca65d6ff0?s=140&d=retro Shirshak Bajgain over 3 years ago

console.log("You are fast learner and codecademy make us learn fast");

51306991d089e483a100728b_480979936 Omar Zaffar Khan over 3 years ago

Javascript

6f6e54283918163caa403876b2c4c853?s=140&d=retro Mohsin Abro over 3 years ago

This is python.


0 votes

permalink

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

awesome. thanks!

557 points
C24294c950e94c88ad849ff6b1512659?s=140&d=retro
Submitted by
Orchid29
almost 3 years ago


0 votes

permalink

enter code here let me try!

360 points
3ab5e759863a183bbb6219911aa3cc24?s=140&d=retro
Submitted by
Zhuzhu880618
over 2 years ago


0 votes

permalink

def lets_try():
    print 'kaboom'

220 points
Aaec58438b89d199236ec13cc88a8d04?s=140&d=retro
Submitted by
helloCole11
over 2 years ago


0 votes

permalink

def getlettergrade(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 getlettergrade(getaverage(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 getlettergrade(get_average(lloyd))

190 points
066a2b4cc57f000cd0338af623a9cd88?s=140&d=retro
Submitted by
PhillyDilly
about 2 years ago


0 votes

permalink

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

254 points
5550e0859113cba7600002fe_165985175
Submitted by
Santiago_77
almost 2 years ago


-1 votes

permalink

I'll try:

blueberry_count = 345

1027 points
Dacbca67435f014a00db9acfb446248e?s=140&d=retro
Submitted by
miphiibunny
almost 3 years ago

1 Comment

Dacbca67435f014a00db9acfb446248e?s=140&d=retro miphiibunny almost 3 years ago

random! :D


-1 votes

permalink

testing

console.log("why did I not learn this before?");

57 points
54acb57c937676e5fd0034a3_135765730
Submitted by
fiatluxury
about 2 years ago


-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 getlettergrade(get_average(lloyd))

190 points
066a2b4cc57f000cd0338af623a9cd88?s=140&d=retro
Submitted by
PhillyDilly
about 2 years ago

1 Comment

066a2b4cc57f000cd0338af623a9cd88?s=140&d=retro PhillyDilly about 2 years ago

def getlettergrade(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 getlettergrade(get_average(lloyd))


-3 votes

permalink

console.log("wonderful!");

118 points
5403607f9c4e9dab2700199b_193515615
Submitted by
Sana Maqsood
over 2 years ago


-4 votes

permalink

console.log('Okay')

1090 points
F9193046f86bbb6cc87b66b1454c6960?s=140&d=retro
Submitted by
Ralph Schreurs
almost 4 years ago


-6 votes

permalink

console.log("I love codeacademy!");

366 points
53ea6339548c3566d900050f_508404442
Submitted by
Cristina Stafie
over 2 years ago