Skip to content
11 changes: 10 additions & 1 deletion week_0/ex_0_advanced/ex_0_advanced_runfile.py
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again, good work with the implementation. Just implement to the code a conditional so that it aborts (or keeps prompting the user) if a character other than an A, T, C, or G is provided. Then, I will revisit this for a final grade.

Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
#YOUR CODE FOR EX_0 ADVANCED HERE
#YOUR CODE FOR EX_0 ADVANCED HERE
Floup = input("Put your DNA sequence here : \n")
DNA= Floup.upper()
LDNA = len(DNA)
A = DNA.count("A")
G = DNA.count("G")
C = DNA.count("C")
T = DNA.count("T")
GC = ((G+C)/LDNA)*100
print("The length of the DNA sequence is %d long.\nThere is %d Adenine, %d Guanine, %d Cytosine and %d Thymine.\nThe GC content is about %.2f" %(LDNA,A,G,C,T,GC))
29 changes: 28 additions & 1 deletion week_0/ex_0_beginner/ex_0_beginner_submit.txt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good on the front of this submission with everything working properly. My very first computer science prof asked us that same question nearly 15 years ago..of course, it was much easier to answer since those were the days before everyone had a smartphone everywhere they went. This will be super useful for imaging, as well, since being able to program macros to count cellular components (etc.) for you will save loads of time and headache..

Keep up the good work.

Score: 0.5/0.5

Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
Copy and paste output of ex_0_beginner_runfile.py below:
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

Hello Nathaniel, I'm Matéo a first year CARe student. I'm a french student from Bordeaux !!! (really pretty city by the way).
I don't really have a precise goal for your courses, I just want to improve globally my skills cause I'll like to specialised in Imaging.

Never I think, I'm just young... technology is everywhere nowadays

Process finished with exit code 0
12 changes: 11 additions & 1 deletion week_0/ex_0_intermediate/ex_0_intermediate_runfile.py
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functionality is correct. The only thing left is to implement conditionals to handle the three main cases of possible incorrect user input, which I will discuss more in detail in class tomorrow.

Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
#YOUR CODE FOR EX_0 INTERMEDIATE HERE
#YOUR CODE FOR EX_0 INTERMEDIATE HERE

import math


ICount = float(input("Input the initial count : \n"))
FCount = float(input("Input the final count : \n"))
Time = float(input("Input the time : \n"))
GRate = (math.log(FCount) - math.log(ICount)) / Time

print("The growth rate is : ", GRate)
29 changes: 29 additions & 0 deletions week_1/ex_1_beginner/ex_1_beginner_submit.txt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very thorough job here completing all of the objectives. Your program does such a good job counting cells that if it were to be a judge on the US Supreme Court..it would be hemo-Sotomayor.

Score: 0.5/0.5

Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
Copy and paste output of ex_1_beginner_runfile.py below:
#YOUR CODE FOR EX_1 BEGINNER HERE

# Define a list of microbial population counts for five consecutive days
MicrobPop = []
Up =[]
NbDays = 6
for Day in range(1, NbDays):
Pop = int(input("Enter the population number for day %d : "%(Day)))
MicrobPop.append(Pop)
if Pop > 200 :
Up.append(Day)

# Calculating the average population
Average = sum(MicrobPop) / len(MicrobPop)
print(f"Average population count: {Average}")

# Calculating the maximum population
MaxPop = max(MicrobPop)
print(f"Maximum population count: {MaxPop}")

# Calculating the minimum population
MinPop = min(MicrobPop)
print(f"Minimum population count: {MinPop}")

# Print the final list
print("The Microbial population for each day: ",MicrobPop)

# Print the days that exceed a pop of 200
print("The day that exceed a population of 200 are: ",Up)
28 changes: 28 additions & 0 deletions week_1/ex_1_intermediate/ex_1_intermediate_submit.txt
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I entered "frog" twice, and then I stopped to quit..everything is going as planned.

Score: 1.5/1.5

Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
Copy and paste output of ex_1_intermediate_runfile.py below:

# I defined the initial dictionary
species = {"Bacteria": 20, "Archaea": 15, "Fungi": 10}

# Loop to calculate and show the number of total samples
samples = sum(species.values())
print(f"Total samples: {samples}")

# Function to add a new item to the dictionary or increase its count if it doesn't exist
def add(species_dict, name):
if name in species_dict:
species_dict[name] += 1
else:
species_dict[name] = 1

while True:
new= input("Enter a new species name (or 'stop' to quit):\n")
if new.lower() == 'stop':
break
else:
add(species, new)

# To test if each species have a value greater than 15
species_greater_than_15 = [species for species, count in species.items() if count > 15]
print(f"Species with sample counts greater than 15: {species_greater_than_15}")

# Show the updated dict
print("Updated Microbial Species Dictionary:\n",species)