<jupyter_start><jupyter_text>String Processing:  Basics<jupyter_code>str1 = "hello!"
print str1
str2 = 'this is in apostrophes'
print str2
print type(str2)

firstName = input("Enter your name:")
print firstName


#greet = "Hello Bob"
#print greet[0]<jupyter_output>hello!
this is in apostrophes
<type 'str'>
Enter your name:"Rachel"
Rachel<jupyter_text>Practice Problems  Usernames<jupyter_code>##Usernames v 1.0
def usernames():
    first = raw_input('Enter your first name: ')
    last = raw_input ('Enter your last name: ')
    uname = first[0]+last[:8]
    x = len(uname)
    print "Your username is %s" %(uname)
    print "There are %d characters in your username \
    and that's good enough for me."%(x)
usernames()<jupyter_output>Enter your first name: rachel
Enter your last name: rakov
Your username is rrakov
There are 6 characters in your username     and that's good enough for me.<jupyter_text>Months<jupyter_code>def month():
#  A program to print abbreviation of a month, given its number

    # months is used as a lookup table
    months = "JanFebMarAprMayJunJulAugSepOctNovDec"

    n = input("Enter a month number (1-12): ")

    # compute starting position of month n in months
    pos = (n-1) * 3
    
    # Grab the appropriate slice from months
    monthAbbrev = months[pos:pos+3]

    # print the result    
    print "The month abbreviation is", monthAbbrev + "."

month()

def month2():
    
    # months is a list used as a lookup table
    months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
              "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"]
    
    n = input("Enter a month number (1-12): ")

    print "The month abbreviation is", months[n-1] + "."

month2()<jupyter_output>Enter a month number (1-12): 9
The month abbreviation is Sept.<jupyter_text>List Examples<jupyter_code>s = "Now is the winter of our discontent"
#x = list(s)

x = s.split()
print x

string = " ".join(x)
print string<jupyter_output>['Now', 'is', 'the', 'winter', 'of', 'our', 'discontent']
Now is the winter of our discontent<jupyter_text>More Months Practice!<jupyter_code>def DateManip():
    datestr = raw_input("Enter a date in the format mm/dd/yyyy:")
    date = datestr.split("/")
    month = int(date[0])
    day = date[1]
    year = date[2]
    months = ["January", "February", "March", "April", "May", "June",
              "July", "August", "September", "October", "November", "December"]    
    month_check = month-1
    monthstr = months[month_check]

    print "Your date is", monthstr, day+",", year
#DateManip()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13468275593616194, 'fraction_numerical': 0.012066952121448035, 'mean_word_length': 3.830827067669173, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '115082', 'license': 'CC0-1.0', 'n_tokens_mistral': 926, 'n_tokens_neox': 872, 'n_words': 282, 'path': 'lecture_03_classcode.ipynb', 'repo_name': 'ssdd3/methods1', 'size': '2569'}