Question: 1 . Create a function called store ( filename ) . The function should do the following: a . Read the data from the filename

1. Create a function called store(filename). The function should do the following:
a. Read the data from the filename specified in its parameter. The data in the file has three parts: height, growth rate and DNA sequence.
b. Split the data into the above mentioned three parts and store them in a list.
c. Return the list.
2. Create a function called main(). This function should do the following:
a. Prompt the user for a filename. For testing purposes, we have provided the files dna1.txt, dna2.txt and dna3.txt here.
b. Add the following code to your main function to test the store function:
```
info = store(filename)
height = info[0]
growth_rate = info[1]
raw_dna = info[2]
print(f"HEIGHT: {height} GROWTH RATE: {growth_rate}
RAW DNA: {raw_dna[:30]}...")
```
3. Name your file dino1.py
After completion of this part, your output should match the sample output and test cases below:
Sample output video
Here is a video recording showcasing the sample output:
Asciinema recording for Part 1
Sample output
Enter filename: dna1.txt
HEIGHT: 0.8 GROWTH RATE: 0.6
RAW DNA: a8C\&T3gA@Gt*AC1!Tca2G\$BmT\#Ap7T...
1 . Create a function called store ( filename ) .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!