- Use the Interactive Interpretor to test to see if you can find an ['ATG' in] the following DNA string:
GTACCTTGATTTCGTATTCTGAGAGGCTGCTGCTTAGCGGTAGCCCCTTGGTTTCCGTGGCAACGGAAAA
-
How about 'TTT'?
-
If you didn't already save the DNA string to a variable, do that now and redo 1 and 2.
-
In the interpretor use
boolto test a variety of values like '', 0, 0.0, FALSE, false, True, true, 'True', 'False' to see if they evalue to True or False. -
Using a text editor, write a script that
- Assigns a value to a variable
- Has a if/else statment in which:
- It prints out a confirmation of truth if the value is true
- It prints out "Not True" if the value is not true.
-
Write a new script that does the same as the question #5, but gets the value you will store in the variable from the command line. Remember
sysin the notes. -
Create a script that has a if/else statement that (remember to write a little bit at a time and test it)
- Test to see if a number is positive or negative
- print "positive" if it is positive
- print "negative" if it is negative
- save it and run it.
-
Add an elif to test if the number is equal to 0. Save it and run it.
-
Add nested tests to your last script
- if it is positive, in addition to printing "positive"
- test if it is smaller than 50
- save it and run it
-
Add more nested tests to your script.
- if it is smaller than 50
- test if the number is even
- if it is smaller than 50 and even, print "it is an even number that is smaller than 50"
- save it and run it
-
Add more nested tests.
- if it is larger than 50,
- test if the number is divisible by 3
- if the number is larger than 50 and divisible by 3, print "it is larger than 50 and divisible by 3"
- save it and run it
-
In your previous nested loops, test the number 50. What prints to the screen? Is it the correct response? If not, you have a semantic error and need to alter your code to be correct with any number.