Skip to content

Commit

Permalink
Enforce V2: switch test_mc to has_chosen + update from tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Schouwenaars committed Aug 10, 2018
1 parent 3ef0c1f commit 1612d95
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions chapter1.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ msg1 = "Incorrect. Python can do simple and quick calculations, but it is much m
msg2 = "Incorrect. There is a very popular framework to build database-driven websites (Django), but Python can do much more."
msg3 = "Incorrect. Python is a powerful tool to do data analysis, but you can also use it for other ends."
msg4 = "Correct! Python is an extremely versatile language."
test_mc(4, [msg1, msg2, msg3, msg4])
Ex().has_chosen(4, [msg1, msg2, msg3, msg4])
```

---
Expand Down Expand Up @@ -455,7 +455,7 @@ msg1 = "The type of `a` is not `int`. Try out `type(a)` and see for yourself."
msg2 = "`b` is not a `bool`, it's a `str`! The fact that `True` is wrapped in double quotes makes it a string."
msg3 = "Correcto perfecto!"
msg4 = "None of the variable's types is correct here. Try `type(a)` and see what type this variable is."
test_mc(3,[msg1, msg2, msg3, msg4])
Ex().has_chosen(3,[msg1, msg2, msg3, msg4])
```

---
Expand Down Expand Up @@ -677,5 +677,5 @@ msg1 = "Incorrect, this command runs perfectly fine."
msg2 = "It's perfectly possible to 'multiply strings' in Python..."
msg3 = "Correct! Because you're not converting `2` to a string with [`str()`](https://docs.python.org/3/library/functions.html#func-str), this will give an error."
msg4 = "`True + False` doesn't error out. Feel free to try it in the console to confirm!"
test_mc(3, [msg1, msg2, msg3, msg4])
Ex().has_chosen(3, [msg1, msg2, msg3, msg4])
```
6 changes: 3 additions & 3 deletions chapter2.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ msg1 = "Correct! As funny as they may look, all these commands are valid ways to
msg2 = "Command B is valid, but it's not the only one!"
msg3 = "Both command B and C are valid; what about command A? Try it out in the console."
msg4 = "Command C is valid, but it's not the only one!"
test_mc(1,[msg1,msg2,msg3,msg4])
Ex().has_chosen(1,[msg1,msg2,msg3,msg4])
```

---
Expand Down Expand Up @@ -665,7 +665,7 @@ house = [["hallway", 11.25],
msg1 = msg2 = "Wrong. `house[-1]` selects the last element of `house`, which is the list `[\"bathroom\", 9.50]`."
msg3 = "Correctomundo! The last piece of the list puzzle is manipulation."
msg4 = "Incorrect. `house[-1]` indeed selects the list that represents the bathroom information, but `[1]` selects the second element of the sublist, not the first. Python uses zero-based indexing!"
test_mc(3, [msg1, msg2, msg3, msg4])
Ex().has_chosen(3, [msg1, msg2, msg3, msg4])
```

---
Expand Down Expand Up @@ -890,7 +890,7 @@ msg1 = "If you first remove `areas[10]`, all elements after index 10 move up a s
msg2 = "`areas[10:11])` will only select the element at index `10`."
msg3 = "Correct! You'll learn about easier ways to remove specific elements from Python lists later on."
msg4 = "This code chunk will not correctly remove the poolhouse-related information. Try again."
test_mc(3, [msg1, msg2, msg3, msg4])
Ex().has_chosen(3, [msg1, msg2, msg3, msg4])
```

---
Expand Down
4 changes: 2 additions & 2 deletions chapter3.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ msg1 = "Incorrect. `[, imag]` shows that `imag` is an optional argument."
msg2 = "This statement is false. `imag` is not a required argument."
msg3 = "Perfect!"
msg4 = "This is almost true, but not entirely. If you don't specify `imag`, it is set to 0."
test_mc(3, [msg1, msg2, msg3, msg4])
Ex().has_chosen(3, [msg1, msg2, msg3, msg4])
```

---
Expand Down Expand Up @@ -715,5 +715,5 @@ Try the different import statements in the IPython shell and see which one cause
```{python}
msg1 = msg2 = msg3 = "Incorrect, try again. Try the different import statements in the IPython shell and see which one causes the line `my_inv([[1, 2], [3, 4]])` to run without errors."
msg4 = "Correct! The `as` word allows you to create a local name for the function you're importing: [`inv()`](https://docs.python.org/3/library/functions.html#inv) is now available as `my_inv()`."
test_mc(4, [msg1, msg2, msg3, msg4])
Ex().has_chosen(4, [msg1, msg2, msg3, msg4])
```
2 changes: 1 addition & 1 deletion chapter4.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ import numpy as np
```{python}
msg1 = msg3 = msg4 = "Incorrect. Try out the different code chunks and see which one matches the target code chunk."
msg2 = "Great job! `True` is converted to 1, `False` is converted to 0."
test_mc(2, [msg1, msg2, msg3, msg4])
Ex().has_chosen(2, [msg1, msg2, msg3, msg4])
```

---
Expand Down
2 changes: 1 addition & 1 deletion course.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: Python is a general-purpose programming language that is becoming m
data and get a competitive edge. Unlike any other Python tutorial, this course focuses on Python specifically for data science.
In our Intro to Python class, you will learn about powerful ways to store and manipulate data as well as cool data science tools to start your own analyses.
Enter DataCamp’s online Python curriculum.
from: "python-base-prod:20"
from: "python-base-prod:v1.0.2"
practice_pool_id: 107
datasets:
baseball.csv: MLB (baseball)
Expand Down

0 comments on commit 1612d95

Please sign in to comment.