From d2efccbd0b0a86c4afdcb73f8e0406671930b8c4 Mon Sep 17 00:00:00 2001 From: Matt Stetz Date: Mon, 16 Sep 2019 14:09:15 -0400 Subject: [PATCH 1/4] typo --- README.md | 2 +- index.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 17b3866876..6f9d93aa56 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ### Introduction -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. +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. 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. diff --git a/index.ipynb b/index.ipynb index 058bfdeff6..5e671b85e0 100644 --- a/index.ipynb +++ b/index.ipynb @@ -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": ["\"art.vandelay@vandelay.co\" # 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.6"}}, "nbformat": 4, "nbformat_minor": 2} \ No newline at end of file +{"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": ["\"art.vandelay@vandelay.co\" # 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.7.3"}}, "nbformat": 4, "nbformat_minor": 2} \ No newline at end of file From 877aa6e1bfc72dbd420768d6388cf084617e1400 Mon Sep 17 00:00:00 2001 From: "taylor.hawks" Date: Thu, 26 Sep 2019 11:38:11 -0400 Subject: [PATCH 2/4] minor changes for redeployment --- README.md | 2 +- index.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f9d93aa56..07b4542454 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ 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. -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. +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. ### Learning Objectives * Manipulate strings with built-in methods diff --git a/index.ipynb b/index.ipynb index 5e671b85e0..2d95f30ff0 100644 --- a/index.ipynb +++ b/index.ipynb @@ -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": ["\"art.vandelay@vandelay.co\" # 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.7.3"}}, "nbformat": 4, "nbformat_minor": 2} \ No newline at end of file +{"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": ["\"art.vandelay@vandelay.co\" # 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} \ No newline at end of file From fa14b2321d6b50b5432840ef23f469f322a2dd38 Mon Sep 17 00:00:00 2001 From: "taylor.hawks" Date: Thu, 26 Sep 2019 13:02:20 -0400 Subject: [PATCH 3/4] minor changes for redeployment From 254efef545e17d048077c12c6592f4de76c32cfb Mon Sep 17 00:00:00 2001 From: Lore Dirick Date: Tue, 29 Oct 2019 15:31:36 -0400 Subject: [PATCH 4/4] minor changes for redeployment --- README.md | 19 +++++++------------ index.ipynb | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 07b4542454..1dac498064 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ # Practice with Data Types -### Introduction +## Introduction 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. 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. -### Learning Objectives +## Learning Objectives * Manipulate strings with built-in methods * Practice coercing data types and changing numbers -### Here to mingle +## Here to mingle The next morning you take out the business card, ready to format it using your programming skills, and here is what we find. ![](https://learn-verified.s3.amazonaws.com/data-science-assets/biz-card-mistakes.jpg) -### String Transformations +## String Transformations 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. @@ -40,7 +40,7 @@ Another important note is the hashtag `#`. In python, hashtags indicate a commen 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. -### Get going with strings +## Get going with strings With that, use the appropriate string method to transform each string to match the desired output in the comment. @@ -72,7 +72,7 @@ As you can see below, the website "vandelay.com" is not preceded by `"www."`. Yo 'vandelay.com' # 'www.vandelay.com' ``` -### String Slicing +## String Slicing 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"```. @@ -81,11 +81,6 @@ Finally, Mr. Vandelay gave us his phone number. Extract the area code by selecti "7285553334" # 728 ``` - -```python -"7285553334" # 728 -``` - -### Summary +## Summary 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. diff --git a/index.ipynb b/index.ipynb index 2d95f30ff0..fc68e6e72f 100644 --- a/index.ipynb +++ b/index.ipynb @@ -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": ["\"art.vandelay@vandelay.co\" # 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} \ No newline at end of file +{"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": ["\"art.vandelay@vandelay.co\" # 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} \ No newline at end of file