diff --git a/Intro/README.md b/Intro/README.md index 5e9e4d7..c2c3ee9 100644 --- a/Intro/README.md +++ b/Intro/README.md @@ -1,6 +1,6 @@ -# CompAssignmentsS23 -## Welcome to CrimTech Comp S23!! - -We are excited to have you!! -You can find all the information you need at: -https://crimsontechcomp.github.io/index.html +# CompAssignmentsS23 +## Welcome to CrimTech Comp S23!! + +We are excited to have you!! +You can find all the information you need at: +https://crimsontechcomp.github.io/index.html diff --git a/Intro/README.md~ b/Intro/README.md~ index 2cc1b5a..ab5c6f6 100644 --- a/Intro/README.md~ +++ b/Intro/README.md~ @@ -1,6 +1,6 @@ -# CompAssignmentsS22 -## Welcome to CrimTech Comp S22!! - -We are excited to have you!! -You can find all the information you need at: -https://crimsontechcomp.github.io/index.html +# CompAssignmentsS22 +## Welcome to CrimTech Comp S22!! + +We are excited to have you!! +You can find all the information you need at: +https://crimsontechcomp.github.io/index.html diff --git a/Intro/responses.txt b/Intro/responses.txt index 8b13789..f0e5967 100644 --- a/Intro/responses.txt +++ b/Intro/responses.txt @@ -1 +1 @@ - +please work i beg diff --git a/Python/random_ints.py b/Python/random_ints.py index 6ee968d..c177d83 100644 --- a/Python/random_ints.py +++ b/Python/random_ints.py @@ -1,20 +1,20 @@ -import random - -def random_ints(): - # Your code here! - - -def test(): - N = 10000 - total_length = 0 - for i in range(N): - l = random_ints() - assert not 0 in l - assert not 11 in l - assert l[-1] == 6 - total_length += len(l) - assert abs(total_length / N - 10) < 1 # checks that the length of the random strings are reasonable. - print("Success!") - -if __name__ == "__main__": - test() +import random + +def random_ints(): + return [random.randint(1, 5) for _ in range(9)] + [6] + + +def test(): + N = 10000 + total_length = 0 + for i in range(N): + l = random_ints() + assert not 0 in l + assert not 11 in l + assert l[-1] == 6 + total_length += len(l) + assert abs(total_length / N - 10) < 1 # checks that the length of the random strings are reasonable. + print("Success!") + +if __name__ == "__main__": + test() diff --git a/Python/rm_smallest.py b/Python/rm_smallest.py index de4885f..f03a065 100644 --- a/Python/rm_smallest.py +++ b/Python/rm_smallest.py @@ -1,13 +1,13 @@ -def rm_smallest(d): - # Your code here! - return 0; - -def test(): - assert 'a' in rm_smallest({'a':1,'b':-10}).keys() - assert not 'b' in rm_smallest({'a':1,'b':-10}).keys() - assert not 'a' in rm_smallest({'a':1,'b':5,'c':3}).keys() - rm_smallest({}) - print("Success!") - -if __name__ == "__main__": - test() +def rm_smallest(d): + # Your code here! + return 0; + +def test(): + assert 'a' in rm_smallest({'a':1,'b':-10}).keys() + assert not 'b' in rm_smallest({'a':1,'b':-10}).keys() + assert not 'a' in rm_smallest({'a':1,'b':5,'c':3}).keys() + rm_smallest({}) + print("Success!") + +if __name__ == "__main__": + test() diff --git a/Python/square_root.py b/Python/square_root.py index f3b7b33..bd5ae44 100644 --- a/Python/square_root.py +++ b/Python/square_root.py @@ -1,15 +1,15 @@ -import math - -def square_root(n): - # Your code here! - return -1; - -def test(): - assert square_root(4) == 2 - assert square_root(0) == 0 - assert square_root("hello") == -1 - assert square_root(-10) == -1 - print("Success!") - -if __name__ == "__main__": - test() +import math + +def square_root(n): + # Your code here! + return -1; + +def test(): + assert square_root(4) == 2 + assert square_root(0) == 0 + assert square_root("hello") == -1 + assert square_root(-10) == -1 + print("Success!") + +if __name__ == "__main__": + test() diff --git a/Python/sum.py b/Python/sum.py index d1ae90e..34c7b4b 100644 --- a/Python/sum.py +++ b/Python/sum.py @@ -1,12 +1,12 @@ -def sum(lst, n): - # Your code here! - return False - -def test(): - assert sum([-1, 1], 0) - assert not sum([0,2,3], 4) - assert sum([0,2,2], 4) - print("Success!") - -if __name__ == "__main__": - test() +def sum(lst, n): + # Your code here! + return False + +def test(): + assert sum([-1, 1], 0) + assert not sum([0,2,3], 4) + assert sum([0,2,2], 4) + print("Success!") + +if __name__ == "__main__": + test()