<jupyter_start><jupyter_text>Week 1 Assignment   Full name:  R:  Title of the notebook: Date:  ![](https://miro.medium.com/max/1600/1*qdAW1TjCN57h1lbuuzvchg.gif)   Question1: Playing with a Markdown cell  Use the empty Markdown cell below, set it up so that it meets all the mentioned requirements:"O Captain! my Captain! our fearful trip is done,The ship has weather’d every rack, the prize we sought is won,The port is near, the bells I hear, the people all exulting,While follow eyes the steady keel, the vessel grim and daring;" [Have this verse in blue and italic]But O heart! heart! heart!O the bleeding drops of red,Where on the deck my Captain lies,Fallen cold and dead. [Have this verse as indented quoting]O Captain! my Captain! rise up and hear the bells;Rise up—for you the flag is flung—for you the bugle trills,For you bouquets and ribbon’d wreaths—for you the shores a-crowding,For you they call, the swaying mass, their eager faces turning; [Have this verse in pink and bold]Here Captain! dear father!This arm beneath your head!It is some dream that on the deck,You’ve fallen cold and dead. [Have this verse as indented quoting]My Captain does not answer, his lips are pale and still,My father does not feel my arm, he has no pulse nor will,The ship is anchor’d safe and sound, its voyage closed and done,From fearful trip the victor ship comes in with object won; [Have this verse in orange, italic and bold]Exult O shores, and ring O bells!But I with mournful tread,Walk the deck my Captain lies,Fallen cold and dead." [Have this verse as indented quoting] [Attach an image of WALT WHITMAN from an online resource here.] ---_ "O Captain! my Captain! our fearful trip is done,__The ship has weather’d every rack, the prize we sought is won,__The port is near, the bells I hear, the people all exulting,__While follow eyes the steady keel, the vessel grim and daring;"_>But O heart! heart! heart!O the bleeding drops of red,Where on the deck my Captain lies,Fallen cold and dead. __O Captain! my Captain! rise up and hear the bells;____Rise up—for you the flag is flung—for you the bugle trills,____For you bouquets and ribbon’d wreaths—for you the shores a-crowding,____For you they call, the swaying mass, their eager faces turning;__> Here Captain! dear father!This arm beneath your head!It is some dream that on the deck,You’ve fallen cold and dead.___My Captain does not answer, his lips are pale and still,______My father does not feel my arm, he has no pulse nor will,______The ship is anchor’d safe and sound, its voyage closed and done,______From fearful trip the victor ship comes in with object won;___> Exult O shores, and ring O bells!But I with mournful tread,Walk the deck my Captain lies,Fallen cold and dead." ![](https://www.pbs.org/wgbh/americanexperience/media/canonical_images/film/Walt_Whitman_2800x1576.jpg) ---  Question2: To quote or not to quote!  Change the cell below to a code cell and run the script:<jupyter_code>print(3 + 7 )
print('3 + 7')
MyNumber = 3+7
MyName = 'Dusty'
print(MyName, MyNumber)
print('MyName', 'MyNumber')
MyNumber = 3+2.0
print(MyNumber)<jupyter_output>10
3 + 7
Dusty 10
MyName MyNumber
5.0<jupyter_text>Answer the following questions based on the output1.  What is the difference between `print( 3 + 7 )` and `print( '3 + 7')`?2.  What is the difference between `print( MyName, MyNumber)` and `print('MyName', 'MyNumber')`3.  Change `MyNumber = 3+2` to `MyNumber = 3+2.0`, and re-run the script, what happens? Why?Write your answers below: > Answer1: print( 3 + 7 ) returns the output of the summation of 3 and 7 which is equal to 10. print( '3 + 7' ) prints the string between quotation marks as is.  > Answer2: print( MyName, MyNumber) returns the content of "MyName" and "MyNumber" variables. But print( 'MyName', 'MyNumber') prints merely those strings.  > Answer3: After modifying the script, "MyNumber" is now updated to 5.0 which is a float. This is because we summed up an integer (3) and a float (2.0) which will always result in a float (5.0)  Question3: Arithmetic and Expressions  Calculate the expressions below by hand taking care to keep track of result type (integer or float):    x1 = 7 + 3 * 6 / 2 - 1        x2 = 2 % 2 + 2 * 2 - 2 / 2        x3 = ( 3 * 9 * ( 3 + ( 9 * 3 / ( 3 ) ) ) ) Write your results below x1 (by hand) = 15 x2 (by hand) = 3 x3 (by hand) = 324  Now write a script to evaluate and print the results, by1. Assigning a value to a variable.  Use the names above        x1 = 7 + 3 * 6 / 2 - 1        x2 = ...        x3 = ...    2. Then print the type and contents of each variable.        print(type(x1),x1)         print(type(x2),x2)        ...<jupyter_code>x1 = 7 + 3 * 6 / 2 - 1   
x2 = 2 % 2 + 2 * 2 - 2 / 2
x3 = ( 3 * 9 * ( 3 + ( 9 * 3 / ( 3 ) ) ) )
print(type(x1),x1) 
print(type(x2),x2)
print(type(x3),x3)<jupyter_output><class 'float'> 15.0
<class 'float'> 3.0
<class 'float'> 324.0<jupyter_text>Question4: String Element Manipulation   Define the string given below in quotes to a meaningful variable name.    some_string ='Computational Thinking' Then1. Index and print all the elements from index positions 2 to 10.        begin = ???        end = ???        print(some_string[begin:end])          2. Index and print the string 'Think'.<jupyter_code>Q4string ='Computational Thinking' #Defining the given string
print(Q4string[2:10])  #Indexing with [#first index:#last index] syntax and printing
print(Q4string[14:19]) #Indexing so that we can get "Think"<jupyter_output>Think
{'fraction_non_alphanumeric': 0.0877800036423238, 'fraction_numerical': 0.029502822800947005, 'mean_word_length': 4.006381039197812, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '216312', 'license': 'CC0-1.0', 'n_tokens_mistral': 1798, 'n_tokens_neox': 1650, 'n_words': 806, 'path': '2-Homework/Spring2021/ES-1/Week 1 Assignment_withSolutions.ipynb', 'repo_name': 'dustykat/engr-1330-psuedo-course', 'size': '5491'}