From 057fc3da96bd3968c3c5d13b50b0b8db47cc18be Mon Sep 17 00:00:00 2001 From: "matthew.mitchell" Date: Thu, 23 May 2019 15:28:35 -0400 Subject: [PATCH 1/6] Fixing typos, updating voice, and consolidating directions to be more motivating and realalistic. --- README.md | 56 +++++++++++++++--------------------- index.ipynb | 81 +++++++++++++++++------------------------------------ 2 files changed, 48 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index a0c16a887a..78bd53428c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# Practice with datatypes +# Practice with Data Types ### Introduction -In the past few lessons, we have learned about working with different types of data in Python: strings, numbers (ints and floats), and booleans. Now let's 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. -In this lesson we'll imagine that we were at a nice social gathering and exchanged business cards with a few people. One of the business cards belongs to Art Vandelay, a new travel agent. We want to use our 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 @@ -13,89 +13,79 @@ In this lesson we'll imagine that we were at a nice social gathering and exchang ### Here to mingle -The next morning we take out the business card, ready to format it using our programming skills, and here is what we find. +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) -Yeah, Mr. Vandelay may not be the best person to get to know or the best at designing business cards, but like Mr. Vandelay, we know that people enter incorrect information on forms all the time. +### String Transformations -So as data scientists, we often need to clean and organize data before we can make sense of it. Let's get to work. +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. -### Solving our first lab - -This is our first lab, and here we'll see that there is some data already provided for us. Next to the data, we will see a comment indicating what the data should look like after we change it. - -For example, let's say we want to capitalize all of the letters of "art vandlay". We'll see the following: +Here's a simple example of how you might go about doing this: ```python -"art vandelay" # "ART VANDELAY" +name = "art vandelay" # "ART VANDELAY" +name.upper() ``` -Notice that there is no output below the gray code above. This is because Jupyter notebooks do not automatically run our code - so they do not automatically know the output. To display the output, we must **run** the code by clicking on the gray cell and then pressing shift + enter. Let's try it in the cell above and see our output appear below. +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. -Ok, once we see the output take a look at the cell below with the hash tag to the right of the string, `'hello'`. This is a comment like the above. Comments are used for programmers to annotate their code, but a comment has no impact on the code. We can see this by running the cell below (again, press shift + enter). +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. ```python 'hello' ### whattttt ``` -After pressing shift+enter on the cell above, we see that still Python happily ignores our comment. So here (and in future labs), a comment will be provided to indicate what we should see as the return value of our code. When we press shift+enter, and the output below matches the comment to the right of our code, we did it correctly. - -> In future labs, Learn will check our code to ensure that we did it correctly. But for our first lab, this works fine. - -To get our output to match the comment we will change it to the following: - - -```python -"art vandelay".upper() # 'ART VANDELAY' -``` +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 -First use the `title` method to capitalize the first letter of each word in "art vandelay"`. +With that, use the appropriate string method to transform each string to match the desired output in the comment. + +Use the `title` method to capitalize the first letter of each word in "art vandelay"`. ```python "art vandelay" # 'Art Vandelay' ``` -Now let's uppercase all of the letters of "Ceo". +Now use the `uppercase` method to capitalize all of the letters of "Ceo". ```python "Ceo" # 'CEO' ``` -Next, write a method that answers a question about our email addresses. Every email address should end with ".com". We can use our knowledge of string methods to check if the email address ends with ".com" and return `True` or `False` accordingly. +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. ```python "art.vandelay@vandelay.co" # False ``` -As you can see below, the website "vandelay.com" is not preceded by `"www."`. We can perform what is called string concatenation to fix this! Use the plus sign, `'+'`, to change the website `'vandelay.com'` to the string `'www.vandelay.com'` by prepending `'www.'`. +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.'`. ```python 'vandelay.com' # 'www.vandelay.com' ``` -### Working with numbers +### String Slicing -Finally, Mr. Vandelay gave us his phone number, but he actually has two other phone numbers that are different from the one listed. All three numbers are basically the same with the exception of the ending. Below, start by coercing the first phone number, which is currently a string, to an `int` and add one. Next do the same to the second phone number but increase it by two. +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"```. ```python -"7285553334" # 7285553335 +"7285553334" # 728 ``` ```python -"7285553334" # 7285553336 +"7285553334" # 728 ``` ### Summary -Our first lab is done! Sweet. In this lab, we practiced working with string methods to operate on and answer questions about strings. We wrote methods that return Booleans and changed strings to integers in order to perform addition. So much of working with data is ensuring that it is properly formatted so we can then operate on it, and in this lab, we saw how to use code to do just that. +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 49a1b94774..6c4d84f096 100644 --- a/index.ipynb +++ b/index.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Practice with datatypes" + "# Practice with Data Types" ] }, { @@ -18,9 +18,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "In the past few lessons, we have learned about working with different types of data in Python: strings, numbers (ints and floats), and booleans. Now let's put that knowledge into action.\n", + "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", - "In this lesson we'll imagine that we were at a nice social gathering and exchanged business cards with a few people. One of the business cards belongs to Art Vandelay, a new travel agent. We want to use our 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. " ] }, { @@ -43,7 +43,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The next morning we take out the business card, ready to format it using our programming skills, and here is what we find." + "The next morning you take out the business card, ready to format it using your programming skills, and here is what we find." ] }, { @@ -57,25 +57,16 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Yeah, Mr. Vandelay may not be the best person to get to know or the best at designing business cards, but like Mr. Vandelay, we know that people enter incorrect information on forms all the time.\n", - "\n", - "So as data scientists, we often need to clean and organize data before we can make sense of it. Let's get to work. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Solving our first lab" + "### String Transformations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "This is our first lab, and here we'll see that there is some data already provided for us. Next to the data, we will see a comment indicating what the data should look like after we change it. \n", + "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", - "For example, let's say we want to capitalize all of the letters of \"art vandlay\". We'll see the following:" + "Here's a simple example of how you might go about doing this:" ] }, { @@ -86,21 +77,22 @@ }, "outputs": [], "source": [ - "\"art vandelay\" # \"ART VANDELAY\"" + "name = \"art vandelay\" # \"ART VANDELAY\"\n", + "name.upper()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Notice that there is no output below the gray code above. This is because Jupyter notebooks do not automatically run our code - so they do not automatically know the output. To display the output, we must **run** the code by clicking on the gray cell and then pressing shift + enter. Let's try it in the cell above and see our output appear below." + "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": [ - "Ok, once we see the output take a look at the cell below with the hash tag to the right of the string, `'hello'`. This is a comment like the above. Comments are used for programmers to annotate their code, but a comment has no impact on the code. We can see this by running the cell below (again, press shift + enter)." + "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. " ] }, { @@ -118,46 +110,23 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "After pressing shift+enter on the cell above, we see that still Python happily ignores our comment. So here (and in future labs), a comment will be provided to indicate what we should see as the return value of our code. When we press shift+enter, and the output below matches the comment to the right of our code, we did it correctly." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "> In future labs, Learn will check our code to ensure that we did it correctly. But for our first lab, this works fine." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To get our output to match the comment we will change it to the following:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "\"art vandelay\".upper() # 'ART VANDELAY'" + "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" + "### 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": [ - "First use the `title` method to capitalize the first letter of each word in \"art vandelay\"`." + "Use the `title` method to capitalize the first letter of each word in \"art vandelay\"`." ] }, { @@ -175,7 +144,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Now let's uppercase all of the letters of \"Ceo\"." + "Now use the `uppercase` method to capitalize all of the letters of \"Ceo\"." ] }, { @@ -193,7 +162,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Next, write a method that answers a question about our email addresses. Every email address should end with \".com\". We can use our knowledge of string methods to check if the email address ends with \".com\" and return `True` or `False` accordingly. " + "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. " ] }, { @@ -211,7 +180,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "As you can see below, the website \"vandelay.com\" is not preceded by `\"www.\"`. We can perform what is called string concatenation to fix this! Use the plus sign, `'+'`, to change the website `'vandelay.com'` to the string `'www.vandelay.com'` by prepending `'www.'`." + "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.'`." ] }, { @@ -230,14 +199,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Working with numbers" + "### String Slicing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Finally, Mr. Vandelay gave us his phone number, but he actually has two other phone numbers that are different from the one listed. All three numbers are basically the same with the exception of the ending. Below, start by coercing the first phone number, which is currently a string, to an `int` and add one. Next do the same to the second phone number but increase it by two." + "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\"```." ] }, { @@ -248,7 +217,7 @@ }, "outputs": [], "source": [ - "\"7285553334\" # 7285553335" + "\"7285553334\" # 728" ] }, { @@ -259,7 +228,7 @@ }, "outputs": [], "source": [ - "\"7285553334\" # 7285553336" + "\"7285553334\" # 728" ] }, { @@ -273,7 +242,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Our first lab is done! Sweet. In this lab, we practiced working with string methods to operate on and answer questions about strings. We wrote methods that return Booleans and changed strings to integers in order to perform addition. So much of working with data is ensuring that it is properly formatted so we can then operate on it, and in this lab, we saw how to use code to do just that." + "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." ] } ], @@ -293,7 +262,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.6.5" } }, "nbformat": 4, From 4cb6511c6862d8aaee64c47da13267a348c0a982 Mon Sep 17 00:00:00 2001 From: Matt Stetz Date: Tue, 3 Sep 2019 18:09:03 -0400 Subject: [PATCH 2/6] correct method --- README.md | 2 +- index.ipynb | 271 +--------------------------------------------------- 2 files changed, 2 insertions(+), 271 deletions(-) diff --git a/README.md b/README.md index 78bd53428c..17b3866876 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Use the `title` method to capitalize the first letter of each word in "art vande "art vandelay" # 'Art Vandelay' ``` -Now use the `uppercase` method to capitalize all of the letters of "Ceo". +Now use the `upper` method to capitalize all of the letters of "Ceo". ```python diff --git a/index.ipynb b/index.ipynb index 6c4d84f096..058bfdeff6 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1,270 +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 `uppercase` 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.5" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} +{"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 From d2efccbd0b0a86c4afdcb73f8e0406671930b8c4 Mon Sep 17 00:00:00 2001 From: Matt Stetz Date: Mon, 16 Sep 2019 14:09:15 -0400 Subject: [PATCH 3/6] 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 4/6] 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 5/6] 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 6/6] 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