1. Using your text editor, create a file called "lastname_firstname_q1.txt" (e.g., for me it would be named howison_james_q1.txt). Ensure that it only has the file extension ".txt" and not ".txt.txt" or some other ending. In this file put this text:
There once was a man named Michael Finnegan,
He had whiskers on his chinnegan,
The wind came up and blew them in ag'in,
Poor old Michael Finnegan (begin ag'in)
Note that the file should end with a newline character and the last line of the file should be empty.
2. Save your q1 file as "lastname_firstname_q2.py". In this file print out the poem using python, so that when we run the file with "python lastname_firstname_q2.py" the poem is output to the console. This requires putting the poem into a string, then outputting that string.
3. Save your q1 file as "lastname_firstname_q3.py". This time split the poem into four strings, one for each line, each ending with a newline character.
4. Save your q3 file as "lastname_firstname_q4.py". In this file we will print out the poem, but we will be able to replace the name "Michael Finnegan" with whatever we put into a variable. At the start of the file define a variable called myName and put a string for your name into it. Yes, your personal name. Split the strings up so that you can use "print myName" wherever "Michael Finnegan" was. Yes, this will most likely ruin the rhyme!
5. Save your q4 file as "lastname_firstname_q5.py". Revise the code to take input and use it instead of defining the myName variable in the file.
The next question require you to learn on your own; we haven't covered these in class. For each I've provided the appropriate search terms.
6. Revise q4 to use 1) the "%" string interpolation syntax. and 2) the str.format() function. Save the files as "lastname_firstname_q6_1.py" and "lastname_firstname_q6_2.py".
Questions 7-10 require written answers, uploaded in a PDF.
7. In Q1, describe what happens to get your .txt file onto the server. You should describe both what you did and what happens in the software to your your file up there.
8. In Q2, describe how the text appears on the screen. Use the word "interpreter" somewhere :)
9. In Q4, describe what happens in the code.
10. For Q6 you had to look up and read about new techniques in python. Describe your process of learning. For example, describe what you did and which resources you read. What did you understand initially and what didn't you understand. What did you try? How did your understanding improve? If you were reading a forum, did the questions that others asked help you? (Note that you can't get this question wrong, even if you never figured out how to answer Q6 you can still get points for Q10, just describe what you tried and what you didn't understand.). The answer for this question should be several paragraphs; you can include screenshots if you like.