Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/00-Python Object and Data Structure Basics/09-Objects and Data Structures Assessment Test.ipynb
Views: 648
Test your knowledge.
** Answer the following questions **
Write (or just say out loud to yourself) a brief description of all the following Object Types and Data Structures we've learned about. You can edit the cell below by double clicking on it. Really this is just to test if you know the difference between these, so feel free to just think about it, since your answers are self-graded.
Double Click HERE to edit this markdown cell and write answers.
Numbers:
Strings:
Lists:
Tuples:
Dictionaries:
Numbers
Write an equation that uses multiplication, division, an exponent, addition, and subtraction that is equal to 100.25.
Hint: This is just to test your memory of the basic arithmetic commands, work backwards from 100.25
Answer these 3 questions without typing code. Then type code to check your answer.
What is the type of the result of the expression 3 + 1.5 + 4?
What would you use to find a number’s square root, as well as its square?
Strings
Given the string 'hello' give an index command that returns 'e'. Enter your code in the cell below:
Reverse the string 'hello' using slicing:
Given the string hello, give two methods of producing the letter 'o' using indexing.
Lists
Build this list [0,0,0] two separate ways.
Reassign 'hello' in this nested list to say 'goodbye' instead:
Sort the list below:
Dictionaries
Using keys and indexing, grab the 'hello' from the following dictionaries:
Can you sort a dictionary? Why or why not?
Tuples
What is the major difference between tuples and lists?
How do you create a tuple?
Sets
What is unique about a set?
Use a set to find the unique values of the list below:
Booleans
For the following quiz questions, we will get a preview of comparison operators. In the table below, a=3 and b=4.
Operator | Description | Example |
---|---|---|
== | If the values of two operands are equal, then the condition becomes true. | (a == b) is not true. |
!= | If values of two operands are not equal, then condition becomes true. | (a != b) is true. |
> | If the value of left operand is greater than the value of right operand, then condition becomes true. | (a > b) is not true. |
< | If the value of left operand is less than the value of right operand, then condition becomes true. | (a < b) is true. |
>= | If the value of left operand is greater than or equal to the value of right operand, then condition becomes true. | (a >= b) is not true. |
<= | If the value of left operand is less than or equal to the value of right operand, then condition becomes true. | (a <= b) is true. |
What will be the resulting Boolean of the following pieces of code (answer fist then check by typing it in!)
Final Question: What is the boolean output of the cell block below?