Adding language to code fences and pre to console logs (#40603)

* added languages to prismjs

* added language to code fences for python for everybody

* multiline pre to python for everybody questions

* multiline pre for data analysis with python

* multiline pre in numpy questions

* single line pre for python for everybody

* single line pre for data analysis with python

* single line pre for numpy

* Revert "multiline pre in numpy questions"

This reverts commit af1a02cdd3.

* fix unneded escaping

commit suggestions from code review

Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>

* Revert "single line pre for numpy"

This reverts commit 5f90981108.

* revert changes to snippet that have a language

* one last code fence to pre

* Revert "fix unneded escaping
"

This reverts commit 64c84a9213.

* Revert "single line pre for data analysis with python"

This reverts commit 3bccaff753.

* Revert "single line pre for python for everybody"

This reverts commit 03a5379062.

* remove unnecessary escape

Co-authored-by: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com>
This commit is contained in:
Ilenia
2021-01-21 19:12:42 +01:00
committed by GitHub
parent 392005154c
commit a38922536c
18 changed files with 100 additions and 134 deletions

View File

@ -62,7 +62,9 @@
"mathml",
"python",
"svg",
"xml"
"xml",
"sql",
"typescript"
],
"theme": "default",
"css": true,

View File

@ -31,47 +31,35 @@ jane()
## --answers--
Zap
<pre>Zap
ABC
jane
fred
jane
jane</pre>
---
Zap
<pre>Zap
ABC
Zap
Zap</pre>
---
ABC
<pre>ABC
Zap
jane
jane</pre>
---
ABC
<pre>ABC
Zap
ABC
ABC</pre>
---
<pre>Zap
Zap
Zap
Zap
Zap</pre>
## --video-solution--

View File

@ -27,27 +27,23 @@ for key in counts:
## --answers--
<pre>annie 42
jan 100</pre>
---
<pre>chuck 1
annie 42
jan 100
jan 100</pre>
---
chuck 1
annie 42
jan 100
<pre>chuck 1</pre>
---
chuck 1
---
\[Error]
<pre>[Error]</pre>
## --video-solution--
1

View File

@ -23,35 +23,27 @@ while True:
## --answers--
0
<pre>0
1
2
2</pre>
---
0
<pre>0
1
2
3
3</pre>
---
1
2
<pre>1
2</pre>
---
1
<pre>1
2
3
3</pre>
## --video-solution--

View File

@ -14,31 +14,31 @@ What SQL command would you use to retrieve all users that have the email address
## --answers--
```
```sql
SELECT Users WHERE email="quincy@freecodecamp.org"
```
---
```
```sql
SELECT Users WHERE email IS "quincy@freecodecamp.org"
```
---
```
```sql
SELECT ALL Users WHERE email="quincy@freecodecamp.org"
```
---
```
```sql
SELECT * FROM Users WHERE email IS "quincy@freecodecamp.org"
```
---
```
```sql
SELECT * FROM Users WHERE email="quincy@freecodecamp.org"
```

View File

@ -33,39 +33,33 @@ q.party()
## --answers--
<pre>
Quincy constructed
Miya constructed
Quincy party count 1
Miya party count 2
Quincy party count 3
</pre>
---
<pre>
Quincy constructed
Miya constructed
Quincy party count 1
Miya party count 1
Quincy party count 2
</pre>
---
<pre>
Quincy constructed
Quincy party count 1
Quincy party count 2
Miya constructed
Miya party count 1
</pre>
## --video-solution--

View File

@ -26,27 +26,31 @@ an.party()
## --answers--
<pre>
So far 1
So far 2
</pre>
---
<pre>
0
0
</pre>
---
<pre>
2
2
</pre>
---
<pre>
2
4
</pre>
## --video-solution--

View File

@ -19,43 +19,39 @@ for n in "banana":
## --answers--
<pre>
n
n
</pre>
---
<pre>
0
1
</pre>
---
<pre>
0
1
2
3
4
5
</pre>
---
<pre>
b
a
n
a
n
a
</pre>
## --video-solution--

View File

@ -23,35 +23,35 @@ for (k,i) in d.items():
## --answers--
<pre>
k i
k i
k i
</pre>
---
<pre>
quincy 0
beau 1
kris 2
</pre>
---
<pre>
quincy 1
beau 5
kris 9
</pre>
---
<pre>
1 quincy
5 beau
9 kris
</pre>
## --video-solution--

View File

@ -36,25 +36,21 @@ print(s.notnull().sum())
---
```
0 True
<pre>0 True
1 True
2 False
3 True
4 False
dtype: bool
```
dtype: bool</pre>
---
```
0 False
<pre>0 False
1 False
2 True
3 False
4 True
dtype: bool
```
dtype: bool</pre>
## --video-solution--

View File

@ -33,36 +33,36 @@ print(s)
## --answers--
```
<pre>
0 1.0
1 1.0
2 2.0
3 3.0
4 3.0
dtype: float64
```
</pre>
---
```
<pre>
0 NaN
1 1.0
2 2.0
3 2.0
4 3.0
dtype: float64
```
</pre>
---
```
<pre>
0 NaN
1 1.0
2 2.0
3 NaN
4 3.0
dtype: float64
```
</pre>
## --video-solution--

View File

@ -33,7 +33,7 @@ print(A[:, :2])
## --answers--
```python
```py
[['a' 'b']]
```

View File

@ -39,33 +39,33 @@ print(certificates_earned)
## --answers--
```
<pre>
Tom 13
Kris 11
Ahmad 9
Beau 7
Name: Longest streak, dtype: int64
```
</pre>
---
```
<pre>
Certificates Time (in months) Longest streak
Tom 8 16 13
Kris 2 5 11
Ahmad 5 9 9
Beau 6 12 7
```
</pre>
---
```
<pre>
Certificates Longest streak
Tom 8 13
Kris 2 11
Ahmad 5 9
Beau 6 7
```
</pre>
## --video-solution--

View File

@ -21,13 +21,11 @@ More resources:
What code would add a "Certificates per month" column to the `certificates_earned` DataFrame like the one below?
```
Certificates Time (in months) Certificates per month
<pre> Certificates Time (in months) Certificates per month
Tom 8 16 0.50
Kris 2 5 0.40
Ahmad 5 9 0.56
Beau 6 12 0.50
```
Beau 6 12 0.50</pre>
## --answers--

View File

@ -36,29 +36,29 @@ print(certificates_earned.iloc[2])
## --answers--
```
<pre>
Tom 16
Kris 5
Ahmad 9
Beau 12
Name: Time (in months), dtype: int64
```
</pre>
---
```
<pre>
Certificates 6
Time (in months) 12
Name: Beau, dtype: int64
```
</pre>
---
```
<pre>
Certificates 5
Time (in months) 9
Name: Ahmad, dtype: int64
```
</pre>
## --video-solution--

View File

@ -34,30 +34,30 @@ print(certificates_earned[certificates_earned > 5])
## --answers--
```
<pre>
Tom True
Kris False
Ahmad False
Beau True
dtype: int64
```
</pre>
---
```
<pre>
Tom 8
Ahmad 5
Beau 6
dtype: int64
```
</pre>
---
```
<pre>
Tom 8
Beau 6
dtype: int64
```
</pre>
## --video-solution--

View File

@ -21,13 +21,13 @@ More resources:
Given a file named `certificates.csv` with these contents:
```
<pre>
Name$Certificates$Time (in months)
Tom$8$16
Kris$2$5
Ahmad$5$9
Beau$6$12
```
</pre>
Fill in the blanks for the missing arguments below:

View File

@ -12,10 +12,10 @@ dashedName: loading-data-and-advanced-indexing
Given a file named `data.txt` with these contents:
```
<pre>
29,97,32,100,45
15,88,5,75,22
```
</pre>
What code would produce the following array?