Skip to content

Commit 254efef

Browse files
committed
minor changes for redeployment
1 parent fa14b23 commit 254efef

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

README.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11

22
# Practice with Data Types
33

4-
### Introduction
4+
## Introduction
55

66
In the past few lessons, you learned about working with different types of data in Python: strings, numbers (ints and floats), and booleans. Now, you'll put that knowledge into action.
77

88
Imagine that you're at a business event and exchanged business cards with a few people. One of the business cards belongs to Art Vandelay, a new travel agent. Here, you'll use your programming skills to format this information correctly.
99

10-
### Learning Objectives
10+
## Learning Objectives
1111
* Manipulate strings with built-in methods
1212
* Practice coercing data types and changing numbers
1313

14-
### Here to mingle
14+
## Here to mingle
1515

1616
The next morning you take out the business card, ready to format it using your programming skills, and here is what we find.
1717

1818
![](https://learn-verified.s3.amazonaws.com/data-science-assets/biz-card-mistakes.jpg)
1919

20-
### String Transformations
20+
## String Transformations
2121

2222
When storing text in a spreadsheet or database programmatically, you will often preprocess the data to ensure that it is properly formatted. For example, you might ensure that a telephone number matches the required format, or that a field on a web form is filled out.
2323

@@ -40,7 +40,7 @@ Another important note is the hashtag `#`. In python, hashtags indicate a commen
4040

4141
After pressing shift+enter on the cell above, you'll see that Python ignores the comment. In Flatiron coding labs, a comment will be provided to indicate what you are aiming to have the code return. This allows you to then easily check your answer upon running your code.
4242

43-
### Get going with strings
43+
## Get going with strings
4444

4545
With that, use the appropriate string method to transform each string to match the desired output in the comment.
4646

@@ -72,7 +72,7 @@ As you can see below, the website "vandelay.com" is not preceded by `"www."`. Yo
7272
'vandelay.com' # 'www.vandelay.com'
7373
```
7474

75-
### String Slicing
75+
## String Slicing
7676

7777
Finally, Mr. Vandelay gave us his phone number. Extract the area code by selecting the first three characters of the string. You can do this using brackets to select characters from the string as in ```"George"[:4]``` which would return ```"Geor"```.
7878

@@ -81,11 +81,6 @@ Finally, Mr. Vandelay gave us his phone number. Extract the area code by selecti
8181
"7285553334" # 728
8282
```
8383

84-
85-
```python
86-
"7285553334" # 728
87-
```
88-
89-
### Summary
84+
## Summary
9085

9186
Congratulations! You just completed your first lab! You practiced working with string methods to operate on and answer questions about strings. You also used methods that return Booleans and sliced strings. So much of working with data is ensuring that it is properly formatted and in this lab, you started practicing your data wrangling skills.

index.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# Practice with Data Types"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Introduction"]}, {"cell_type": "markdown", "metadata": {}, "source": ["In the past few lessons, you learned about working with different types of data in Python: strings, numbers (ints and floats), and booleans. Now, you'll put that knowledge into action.\n", "\n", "Imagine that you're at a business event and exchanged business cards with a few people. One of the business cards belongs to Art Vandelay, a new travel agent. Here, you'll use your programming skills to format this information correctly. "]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Learning Objectives\n", "* Manipulate strings with built-in methods\n", "* Practice coercing data types and changing numbers"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Here to mingle "]}, {"cell_type": "markdown", "metadata": {}, "source": ["The next morning you take out the business card, ready to format it using your programming skills, and here is what we find."]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](https://learn-verified.s3.amazonaws.com/data-science-assets/biz-card-mistakes.jpg)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### String Transformations"]}, {"cell_type": "markdown", "metadata": {}, "source": ["When storing text in a spreadsheet or database programmatically, you will often preprocess the data to ensure that it is properly formatted. For example, you might ensure that a telephone number matches the required format, or that a field on a web form is filled out. \n", "\n", "Here's a simple example of how you might go about doing this:"]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["name = \"art vandelay\" # \"ART VANDELAY\"\n", "name.upper()"]}, {"cell_type": "markdown", "metadata": {}, "source": ["If you haven't already, put your cursor into the cell above and press `shift + enter` to run the code in the cell. You should see an updated output produced by the `.upper()` string method. "]}, {"cell_type": "markdown", "metadata": {}, "source": ["Another important note is the hashtag `#`. In python, hashtags indicate a comment. Comments are notes used to provide additional information but are ignored by the computer when running the code. "]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["'hello' ### whattttt"]}, {"cell_type": "markdown", "metadata": {}, "source": ["After pressing shift+enter on the cell above, you'll see that Python ignores the comment. In Flatiron coding labs, a comment will be provided to indicate what you are aiming to have the code return. This allows you to then easily check your answer upon running your code."]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Get going with strings\n", "\n", "With that, use the appropriate string method to transform each string to match the desired output in the comment."]}, {"cell_type": "markdown", "metadata": {}, "source": ["Use the `title` method to capitalize the first letter of each word in \"art vandelay\"`."]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"art vandelay\" # 'Art Vandelay'"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Now use the `upper` method to capitalize all of the letters of \"Ceo\"."]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"Ceo\" # 'CEO'"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Next, write a method that verifies whether an email addresses is valid. To make this introductory example simple, assume that every email address should end with \".com\". With that, use your knowledge of string methods to check if the email address ends with \".com\" and return `True` or `False` accordingly. "]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"[email protected]\" # False"]}, {"cell_type": "markdown", "metadata": {}, "source": ["As you can see below, the website \"vandelay.com\" is not preceded by `\"www.\"`. You can perform string concatenation to fix this! string concatenation allows you to join two strings. It works just like numerical addition. For example, ```\"This is the start\" + \"and this is the end\"``` would return ```\"This is the start and this is the end\"```. Use string concatenation to change the website `'vandelay.com'` to the string `'www.vandelay.com'` by prepending `'www.'`."]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true, "scrolled": true}, "outputs": [], "source": ["'vandelay.com' # 'www.vandelay.com'"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### String Slicing"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Finally, Mr. Vandelay gave us his phone number. Extract the area code by selecting the first three characters of the string. You can do this using brackets to select characters from the string as in ```\"George\"[:4]``` which would return ```\"Geor\"```."]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"7285553334\" # 728"]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"7285553334\" # 728"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Summary"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Congratulations! You just completed your first lab! You practiced working with string methods to operate on and answer questions about strings. You also used methods that return Booleans and sliced strings. So much of working with data is ensuring that it is properly formatted and in this lab, you started practicing your data wrangling skills."]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.8"}}, "nbformat": 4, "nbformat_minor": 2}
1+
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# Practice with Data Types"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Introduction"]}, {"cell_type": "markdown", "metadata": {}, "source": ["In the past few lessons, you learned about working with different types of data in Python: strings, numbers (ints and floats), and booleans. Now, you'll put that knowledge into action.\n", "\n", "Imagine that you're at a business event and exchanged business cards with a few people. One of the business cards belongs to Art Vandelay, a new travel agent. Here, you'll use your programming skills to format this information correctly. "]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Learning Objectives\n", "* Manipulate strings with built-in methods\n", "* Practice coercing data types and changing numbers"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Here to mingle "]}, {"cell_type": "markdown", "metadata": {}, "source": ["The next morning you take out the business card, ready to format it using your programming skills, and here is what we find."]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](https://learn-verified.s3.amazonaws.com/data-science-assets/biz-card-mistakes.jpg)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## String Transformations"]}, {"cell_type": "markdown", "metadata": {}, "source": ["When storing text in a spreadsheet or database programmatically, you will often preprocess the data to ensure that it is properly formatted. For example, you might ensure that a telephone number matches the required format, or that a field on a web form is filled out. \n", "\n", "Here's a simple example of how you might go about doing this:"]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["name = \"art vandelay\" # \"ART VANDELAY\"\n", "name.upper()"]}, {"cell_type": "markdown", "metadata": {}, "source": ["If you haven't already, put your cursor into the cell above and press `shift + enter` to run the code in the cell. You should see an updated output produced by the `.upper()` string method. "]}, {"cell_type": "markdown", "metadata": {}, "source": ["Another important note is the hashtag `#`. In python, hashtags indicate a comment. Comments are notes used to provide additional information but are ignored by the computer when running the code. "]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["'hello' ### whattttt"]}, {"cell_type": "markdown", "metadata": {}, "source": ["After pressing shift+enter on the cell above, you'll see that Python ignores the comment. In Flatiron coding labs, a comment will be provided to indicate what you are aiming to have the code return. This allows you to then easily check your answer upon running your code."]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Get going with strings\n", "\n", "With that, use the appropriate string method to transform each string to match the desired output in the comment."]}, {"cell_type": "markdown", "metadata": {}, "source": ["Use the `title` method to capitalize the first letter of each word in \"art vandelay\"`."]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"art vandelay\" # 'Art Vandelay'"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Now use the `upper` method to capitalize all of the letters of \"Ceo\"."]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"Ceo\" # 'CEO'"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Next, write a method that verifies whether an email addresses is valid. To make this introductory example simple, assume that every email address should end with \".com\". With that, use your knowledge of string methods to check if the email address ends with \".com\" and return `True` or `False` accordingly. "]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"[email protected]\" # False"]}, {"cell_type": "markdown", "metadata": {}, "source": ["As you can see below, the website \"vandelay.com\" is not preceded by `\"www.\"`. You can perform string concatenation to fix this! string concatenation allows you to join two strings. It works just like numerical addition. For example, ```\"This is the start\" + \"and this is the end\"``` would return ```\"This is the start and this is the end\"```. Use string concatenation to change the website `'vandelay.com'` to the string `'www.vandelay.com'` by prepending `'www.'`."]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true, "scrolled": true}, "outputs": [], "source": ["'vandelay.com' # 'www.vandelay.com'"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## String Slicing"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Finally, Mr. Vandelay gave us his phone number. Extract the area code by selecting the first three characters of the string. You can do this using brackets to select characters from the string as in ```\"George\"[:4]``` which would return ```\"Geor\"```."]}, {"cell_type": "code", "execution_count": null, "metadata": {"collapsed": true}, "outputs": [], "source": ["\"7285553334\" # 728"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Summary"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Congratulations! You just completed your first lab! You practiced working with string methods to operate on and answer questions about strings. You also used methods that return Booleans and sliced strings. So much of working with data is ensuring that it is properly formatted and in this lab, you started practicing your data wrangling skills."]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.6"}}, "nbformat": 4, "nbformat_minor": 2}

0 commit comments

Comments
 (0)