Skip to content
Snippets Groups Projects
Commit af294e88 authored by tuhe's avatar tuhe
Browse files

updates

parents e6e185f7 c85068a4
Branches
No related tags found
No related merge requests found
Showing
with 490 additions and 11 deletions
......@@ -6,3 +6,4 @@ pyfiglet
colorama
unitgrade>=0.1.23
unitgrade-devel>=0.1.37 # Required to run automatic evaluation (load tokens etc.)
requests # For unitgrade, may remove later.
......@@ -6,4 +6,4 @@ pyfiglet
colorama
importnb
unitgrade # Perhaps just this and not the other.
requests # For unitgrade, may remove later.
from snipper import snip_dir
if __name__ == "__main__":
snip_dir(source_dir="./", dest_dir="../output", exclude=['*.token', 'deploy.py'])
pass
import itertools
def bacteriaGrowth1(n0, alpha, K, N):
# TODO: 7 lines missing.
raise NotImplementedError("Insert your solution and remove this error.")
return t
def bacteriaGrowth1(n0, alpha, K, N):
# if n0?????
# retu????
# for t in iter??????????????
# n0 = (1 + alpha *??????????????????
# if n0?????
# br???
# t +???
raise NotImplementedError("Insert your solution and remove this error.")
return t
def bacteriaGrowth1(n0, alpha, K, N):
# TODO: The following lines have been permuted. Can you put them back in order?
# t += 1
# if n0 > N:
# n0 = (1 + alpha * (1-n0 / K) ) * n0
# break
# for t in itertools.count():
# if n0 > N:
# return 0
raise NotImplementedError("Insert your solution and remove this error.")
return t
def bacteriaGrowth1(n0, alpha, K, N):
# if ?0 ? ?:
# return 0
# for ? in ?????????.?????():
# ?0 = (1 + ????? ? (1-?0 ? ?) ) ? ?0
# if ?0 ? ?:
# ?????
# ? += 1
raise NotImplementedError("Insert your solution and remove this error.")
return t
from snipper import snip_dir
if __name__ == "__main__":
snip_dir(source_dir="./", dest_dir="../output", exclude=['*.token', 'deploy.py'])
pass
\ No newline at end of file
import itertools
def bacteriaGrowth1(n0, alpha, K, N):
if n0 > N: #!b
return 0
for t in itertools.count():
n0 = (1 + alpha * (1-n0 / K) ) * n0
if n0 > N:
break
t += 1 #!b
return t
def bacteriaGrowth1(n0, alpha, K, N):
if n0 > N: #!b;halfquestionmarks
return 0
for t in itertools.count():
n0 = (1 + alpha * (1-n0 / K) ) * n0
if n0 > N:
break
t += 1 #!b
return t
def bacteriaGrowth1(n0, alpha, K, N):
if n0 > N: #!b;permute
return 0
for t in itertools.count():
n0 = (1 + alpha * (1-n0 / K) ) * n0
if n0 > N:
break
t += 1 #!b
return t
def bacteriaGrowth1(n0, alpha, K, N):
if n0 > N: #!b;questionmarks
return 0
for t in itertools.count():
n0 = (1 + alpha * (1-n0 / K) ) * n0
if n0 > N:
break
t += 1 #!b
return t
\ No newline at end of file
No preview for this file type
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File deleted
from report1intro import Report1Flat
from looping_tests import Report1Flat
from unitgrade_private.hidden_create_files import setup_grade_file_report
from snipper import snip_dir
if __name__ == "__main__":
setup_grade_file_report(Report1Flat, minify=False, obfuscate=False, execute=False, with_coverage=True)
setup_grade_file_report(Report1Flat, minify=False, obfuscate=False, execute=False, with_coverage=False)
# Deploy the files using snipper: https://gitlab.compute.dtu.dk/tuhe/snipper
snip_dir(source_dir="", dest_dir="../../students/week5", exclude=['*.token', 'deploy.py'])
import numpy as np
import itertools
def bacteriaGrowth(n0, alpha, K, N): #!f
def bacteriaGrowth(n0, alpha, K, N):
"""
Calculate time until bacteria growth exceed N starting from a population of n0 bacteria.
hints:
* You need to update the number of bacteria n0 within a loop
"""
if n0 > N:
if n0 > N: #!b;permute
return 0
for t in itertools.count():
n0 = (1 + alpha * (1-n0 / K) ) * n0
if n0 > N:
break
t += 1
t += 1 #!b
return t
def clusterAnalysis(reflectance):
......
This diff is collapsed.
This diff is collapsed.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment