Recently Published
Discussion 6
Discussion 6
Nusaiba Tazreen Tanisha - Assignment 1
Question 1
Imagine, you have a DNA sequence consisting of letters from "A", "C", "G", and "T".
a. Create two variables — gene1: with 8 characters and gene2: with 3 characters.
b. Concatenate the two variables
c. Create a substring from variable 1 starting from index 2 to 5
d. Does the pattern of gene2 exist in gene1? If yes, find the index.
Here is an example of a DNA sequence of length 5:
DNA = “ACCGT”
Question 2
Select any two integer numbers and store them in two variables. Now do the following arithmetic
operation on the two numbers and store each result in variables and print it.
1. Add
2. subtract
3. multiply
4. divide
5. power
6. modulo
The “Add” is done for you as an example
var1 = 10
var2 = 3
result_add = var1 + var2
print(result_add)
Question 3
Use condition and loop to assign letter grade to a vector of scores.
● Create a scores vector with the following numbers: 100, 90, 50, 20, 30, 88, 66,
75, 71, 91, 0, 45, 61
● Now use a for loop and conditional (if else) to determine letter grade for each
score.
● Create an age vector with 13 numbers ranging from 20 to 80 years.
● Now use calculate the correlation between age and score and explain the
correlation nature.
● Select 3-10 elements from scores and age to store them in new variables.
● Now calculate the correlation again between these two new variables.
Cyclistic Business Case
Data munging process for the 2023 data sets of Divvy Bikes™