User Tools

Site Tools


exam

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
exam [2018/11/01 09:42]
dokuroot created
exam [2018/11/05 09:24] (current)
dokuroot
Line 4: Line 4:
 ---- ----
  
-**INSTRUCTIONS+**INSTRUCTIONS** 
 +\\ 
 +\\
 You cannot use any modules that have to be imported into your code. You cannot use any modules that have to be imported into your code.
 \\ \\
Line 14: Line 16:
 \\ \\
 \\ \\
-2. [20 pts] Write a function, ''​word_count(input_file)'',​ that returns the number of lines and characters (all characters including white space, except new lines) in a file as a tuple. ​ The function should work with any size file (i.e. don't read the entire file into memory). The function should exit gracefully if the file can't be opened and should not leave the file open. +2. [20 pts] Write a function, ''​word_count(input_file)'',​ that returns the number of lines and characters (all characters including white space, except new lines) in a file. The return value should be a tuple. ​ The function should work with any size file (i.e. don't read the entire file into memory). The function should exit gracefully if the file can't be opened and should not leave the file open. 
 \\ \\
 \\ \\
Line 31: Line 33:
 \\ \\
 \\ \\
-5. [20] Write a function, ''​motif_coordinates(sequence,​ motif)'',​ that returns the start and end position of the first occurrence of a motif within a sequence as a tuple. Report the position relative to  a starting position of 1 not the first python index of 0.  For example, given the sequence ​ATGCTGTTAGCGA ​and the motif CAG, the function would return (11, 13). +5. [20] Write a function, ''​motif_coordinates(sequence,​ motif)'',​ that returns the start and end position of the first occurrence of a motif within a sequence as a tuple. Report the position relative to  a starting position of 1 not the first python index of 0.  For example, given the sequence ​ATGCTGTTAGCAG ​and the motif CAG, the function would return (11, 13).
exam.1541086953.txt.gz · Last modified: 2018/11/01 09:42 by dokuroot