mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): clarify Step 9 instructions for adding second print (#65744)
This commit is contained in:
-26
@@ -11,8 +11,6 @@ The output is `False`, which shows that `score` is not an `int`.
|
|||||||
|
|
||||||
Another common kind of number in Python is `float`, which represents a number with decimals. Replace `int` with `float` in the existing `isinstance()` call to confirm this.
|
Another common kind of number in Python is `float`, which represents a number with decimals. Replace `int` with `float` in the existing `isinstance()` call to confirm this.
|
||||||
|
|
||||||
Finally, print `score` and its data type to complete the report card.
|
|
||||||
|
|
||||||
# --hints--
|
# --hints--
|
||||||
|
|
||||||
You should replace `int` with `float` in the existing `isinstance(score, int)` call.
|
You should replace `int` with `float` in the existing `isinstance(score, int)` call.
|
||||||
@@ -24,12 +22,6 @@ You should replace `int` with `float` in the existing `isinstance(score, int)` c
|
|||||||
`) })
|
`) })
|
||||||
```
|
```
|
||||||
|
|
||||||
You should print `score` and `type(score)` using a comma separator.
|
|
||||||
|
|
||||||
```js
|
|
||||||
({ test: () => runPython(`assert _Node(_code).has_call("print(score, type(score))")`) })
|
|
||||||
```
|
|
||||||
|
|
||||||
# --seed--
|
# --seed--
|
||||||
|
|
||||||
## --seed-contents--
|
## --seed-contents--
|
||||||
@@ -47,24 +39,6 @@ print(age, type(age))
|
|||||||
score = 80.5
|
score = 80.5
|
||||||
--fcc-editable-region--
|
--fcc-editable-region--
|
||||||
print(isinstance(score, int))
|
print(isinstance(score, int))
|
||||||
|
|
||||||
--fcc-editable-region--
|
--fcc-editable-region--
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# --solutions--
|
|
||||||
|
|
||||||
```py
|
|
||||||
name = 'Alice'
|
|
||||||
print(name, type(name))
|
|
||||||
|
|
||||||
is_student = True
|
|
||||||
print(is_student, type(is_student))
|
|
||||||
|
|
||||||
age = 20
|
|
||||||
print(age, type(age))
|
|
||||||
|
|
||||||
score = 80.5
|
|
||||||
print(isinstance(score, float))
|
|
||||||
print(score, type(score))
|
|
||||||
```
|
|
||||||
|
|||||||
+59
@@ -0,0 +1,59 @@
|
|||||||
|
---
|
||||||
|
id: 694648acde178bb8202d9517
|
||||||
|
title: Step 10
|
||||||
|
challengeType: 20
|
||||||
|
dashedName: step-10
|
||||||
|
---
|
||||||
|
|
||||||
|
# --description--
|
||||||
|
|
||||||
|
The output is `True`, confirming that `score` is a `float`.
|
||||||
|
|
||||||
|
Complete the report card by printing the `score` value along with its data type using a single `print()` statement.
|
||||||
|
|
||||||
|
# --hints--
|
||||||
|
|
||||||
|
You should print `score` and `type(score)` using a comma separator.
|
||||||
|
|
||||||
|
```js
|
||||||
|
({ test: () => runPython(`assert _Node(_code).has_call("print(score, type(score))")`) })
|
||||||
|
```
|
||||||
|
|
||||||
|
# --seed--
|
||||||
|
|
||||||
|
## --seed-contents--
|
||||||
|
|
||||||
|
```py
|
||||||
|
name = 'Alice'
|
||||||
|
print(name, type(name))
|
||||||
|
|
||||||
|
is_student = True
|
||||||
|
print(is_student, type(is_student))
|
||||||
|
|
||||||
|
age = 20
|
||||||
|
print(age, type(age))
|
||||||
|
|
||||||
|
score = 80.5
|
||||||
|
print(isinstance(score, float))
|
||||||
|
--fcc-editable-region--
|
||||||
|
|
||||||
|
--fcc-editable-region--
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
# --solutions--
|
||||||
|
|
||||||
|
```py
|
||||||
|
name = 'Alice'
|
||||||
|
print(name, type(name))
|
||||||
|
|
||||||
|
is_student = True
|
||||||
|
print(is_student, type(is_student))
|
||||||
|
|
||||||
|
age = 20
|
||||||
|
print(age, type(age))
|
||||||
|
|
||||||
|
score = 80.5
|
||||||
|
print(isinstance(score, float))
|
||||||
|
print(score, type(score))
|
||||||
|
```
|
||||||
@@ -13,7 +13,8 @@
|
|||||||
{ "id": "694648acde178bb8202d9513", "title": "Step 6" },
|
{ "id": "694648acde178bb8202d9513", "title": "Step 6" },
|
||||||
{ "id": "694648acde178bb8202d9514", "title": "Step 7" },
|
{ "id": "694648acde178bb8202d9514", "title": "Step 7" },
|
||||||
{ "id": "694648acde178bb8202d9515", "title": "Step 8" },
|
{ "id": "694648acde178bb8202d9515", "title": "Step 8" },
|
||||||
{ "id": "694648acde178bb8202d9516", "title": "Step 9" }
|
{ "id": "694648acde178bb8202d9516", "title": "Step 9" },
|
||||||
|
{ "id": "694648acde178bb8202d9517", "title": "Step 10" }
|
||||||
],
|
],
|
||||||
"blockLabel": "workshop",
|
"blockLabel": "workshop",
|
||||||
"usesMultifileEditor": true,
|
"usesMultifileEditor": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user