What this checks
- You can predict what short Python, R and shell commands do.
- You know the 0-based (Python) versus 1-based (R) difference.
- You can handle missing values and type errors.
- You can count reads and sequences from the command line.
Before you start
- Finish the Level 1 basics for Python, R and the command line.
- No notes on the first try. The point is to find out what you can recall, which is also one of the best ways to make it stick.
How this checkpoint works
Answer all ten questions. When you finish, the page shows your score. 7 of 10 counts as a pass; aim for 8 or more before moving on. Every explanation links to the lesson to review.
This is a self-check, not an exam. The answers live in the page, so it only works if you answer honestly before reading the explanation. If you score below 7, review the linked lessons, wait a day or two, then reload and try again. Coming back after a break helps you remember more than re-reading straight away.
The ten questions
Scenario questions. Pick the best answer; some wrong answers are tempting on purpose.
seq = "TTAGC"print(seq[3])counts after this runs?counts = {}for base in "AACG": counts[base] = counts.get(base, 0) + 1counts.get(base, 0) returns the current count, or 0 if the base has not been seen yet, then adds 1. A dictionary maps each base to its count. Review: Python basics and Python intermediate.genes = ["TP53", "MYC"]genes.append("KRAS")print(len(genes))append adds one item to the end of the list, so it now holds three genes. len counts items in a list, not letters. Review: Python basics.for base in "ACG": print(base)for loop over a string visits one letter at a time, and each print starts a new line (Python tutorial). Review: Python basics.x <- c(5, 12, 8, 20)x[x > 10]x > 10 makes TRUE or FALSE for each value, and using it inside the brackets keeps only the TRUE ones. This filtering pattern is everywhere in R. Review: R intermediate.mean(c(2, NA, 4)) returns NA. How do you get the mean of the values you do have?na.rm = TRUE removes missing values first. Replacing NA with 0 would wrongly pull the mean down to 2. Review: First steps in RStudio.wc -l reads.fastq reports 4,000 lines. How many reads does the file contain?sort ids.txt | uniq | wc -l tell you?sort puts identical lines next to each other, uniq removes adjacent repeats, and wc -l counts what is left. The pipe | passes each command's output to the next. Review: Command-line basics.^ means "at the start of the line", so only header lines are counted. Counting lines does not work, because one sequence can span many lines. Review: Command-line basics.Sources & further reading
- Python Software Foundation. The Python Tutorial, chapters 3 to 5. docs.python.org
- Cock PJ, Fields CJ, Goto N, Heuer ML, Rice PM. The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants. Nucleic Acids Research 38: 1767-1771, 2010. (why FASTQ has four lines per read) doi:10.1093/nar/gkp1137
Last reviewed: November 2026.