String Processing problems

Complete the following program so that it does the indicated processing for each section.  After it is all running properly make a copy of the source and also a copy of the output. Make sure you have documented your program with your name at the top.

BTW: To get a copy of the console output into a file just right click in the console window and select  save history log , change name and location to where you want it and it will be saved there for you to print.

""
Homework 7: String processing
@author: Put your name here
"""
#part A
# Start with the following command modified as requested

 name='John Quincy Adams' # put your name here First middle last

# Write code to search for the two blanks blanks and knowing the
# position of the blanks extract the first name, middle name and
# last name using slices. Reconnect using concatenation to get
# a new string which had the form last, first middle initial
# Use subscripting
# Search for the two blanks storing their position in pos1 and pos2
# Use these two values to extract the sections

#part B
#Calculate the GC-content. ee http://en.wikipedia.org/wiki/GC-content
#for the following string dna
#use the round() function to print output to 2 decimal places

 dna='ctgaaccacgttgtggggcaaactggcgtgtgctatataaatacgggg'

#part C
#Go the gutenberg project web site and download Bram Stoker's Dracula
#Be sure and download the pure ascii file entitled 345.txt from more
#files.
# you are to open this and traverse the file, one line at a time
# counting the number of lines the word 'Count' appears in
#Also count the number of lines that both Count and Dracula appears
#print out both counts
#Print out the second line that both appear in

 

 

Comments are closed.