@@ -0,0 +1,2387 @@
+from __future__ import print_function  # Ignore this line until next month%0A# Section 3 of Lesson 2%0A%0A# At this point you've already seen strings. A string looks like the%0A# following:%0A%22This is a string%22%0A'This is also a string'%0A%22%22%22This is a string too%22%22%22%0A%0A# Like everything else in Python, you can bind a string to a name.%0Amy_string = %22This is my string, there are many like it, but this is mine%22%0A%0A# We previously used strings to help us understand what we were printing.%0Aprint(my_string)%0A%0A# There are a lot of things that you can do to a string.%0A# You can take a string and make every letter inside of it uppercase.%0Amy_uppercase_string = my_string.upper()%0Aprint(my_uppercase_string)%0A%0A# You can take a string and make every letter inside of it lowercase.%0Amy_lowercase_string = my_string.lower()%0Aprint(my_lowercase_string)%0A%0A# You can create a new string by adding another string to it.%0A# You can add to the beginning of it.%0Amy_new_string = %22I quoth, %22 + my_string%0A# Or you can add to the end of it.%0Amy_newer_string = my_string + '.'%0Aprint(my_new_string)%0Aprint(my_newer_string)%0A%0A# You can replace sections of it.%0Amy_program = my_string.replace(%22string%22, 'program')%0Aprint(my_program)%0A%0A# You can replace any part of it, not just whole words.%0Amy_i_less_string = my_string.replace('i', '')%0Aprint(my_i_less_string)%0A%0A# You can access arbitrary letters in a string. If you want the 11th letter,%0A# you use 10 to get it.%0Aprint(%22my_string%5B10%5D =%22, my_string%5B10%5D)%0A%0A# The first letter of a string is found by using 0. In most programming%0A# languages, we begin counting at 0.%0Aprint(%22The first letter of my_string is%22, my_string%5B0%5D)%0A%0A# You can also take subsections of a string. Let's say you want the piece of%0A# the string that starts with the second letter and ends before the 7th%0A# letter. To get that substring you would do the following:%0Aprint(my_string%5B1:6%5D)%0A%0A# This is called a slice.it starts with the 2nd letter and ends at the letter%0A# before the 7th. So what you have is%0Aprint(my_string%5B1%5D + my_string%5B2%5D + my_string%5B3%5D + my_string%5B4%5D +%0A      my_string%5B5%5D)%0A%0A# If you wanted to get that 7th letter, you would do%0Aprint(my_string%5B1:7%5D)%0A%0A# There's so much more that can be done with strings but we don't have the%0A# time to work through all of them. At this point the presentation will move%0A# on, but below are a bunch more examples that we would like to encourage you%0A# to experiment with and enjoy.%0A

Add presentation section of lesson 2's part on strings