Question: 36, Lab 8 Instructions, More about Strings, s ing operations Learning a programming language, like learning to play a musical instrument, requires practice. A musician

36, Lab 8 Instructions, More about Strings, s ing operations Learning a programming language, like learning to play a musical instrument, requires practice. A musician practices piano by playing scales. A programmer can \"practice\" python by trying various methods, functions, command and operators. Part 1: (10 points) Play with python. See chapter 8, \"More about Strings\" and experiment in the shell. Look at pages in the \"More About Strings\" chapter and try things with strings. Go page by page or item by item. In the python shell, type in statements and see what happens. Reading specs can be boring - playing can be fun. Item S to try: pn 1salphs iC . Index]], try, except. len(), +, +=, = ha, isdiqit. i i ISS[ | i . oi hr. Many of these items on with the shell accumulate to over two hundred lines. Don't worry about python error messages, mistakes are OK. Just play in the shell. Try things that make sense. When done, save the shell output to: DDHH_L8_Lastname_shell.txt. (In the upper left corner of the shell, see: File -> Save) Save as file type .txt. The output is not a python script; itis a text file record of your interactive experimentation. | grade this part based on finding the items underlined above in your shell output, and the number of lines created. Part 2: (5 points) Create and test function acronym(). Here is the IPO: Input: One string. Expect this string to contain zero to several short words. Processing: get the first letter of each word. capitalize it, and form a new, short string If the first letter of the word is non alphabetic (not a..z, A..Z), skip that word. If no valid letters are found, return the empty string. Do not allow any string to cause a crash. Output: return a short string of the initials. Do not print anything inside the function itself. Testing: print the results of; acronym(\"in case you missed it"); expect ICYMI acronym(\"Austin Community College\"); expect: ACC acronym(\"Stephen F. Austin State University"); expect: SFASU acronym(\"net due: 8% tax\"); expect: NDT
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
