Scientific Computing
activity14.py
and save it to your cs100/ch3
folder.myCourse = "CS100 Scientific Computing"
. For the following questions, write code to check your answer, and write your answer in comments above it.
myCourse
?print( myCourse[-9:-5])
print( myCourse[17:21])
print( myCourse[17] )
?'S'
in myCourse
, and what command do you use to find it?print('100' in myCourse)
?print('130' not in myCourse)
?print('wow'*5)
?print( ('.'*3 + 'y')*3 )
?myCourse
with "Exam 1"
.myCourse
string so that it is center justified and takes up 40 characters of space. Hint: use the center
function.countACGT(seq)
that displays the number of a
, c
, g
, and t
characters that occur in a DNA sequence. Call your function to test it with the string “aactTtgttAct”. For example, calling the function countACGT('aactTtgttAct')
should display:
No. of A: 3
No. of C: 2
No. of G: 1
No. of T: 6
Other letters: 0
Submit your working activity14.py
to Moodle.