Skip to content

Lab2 #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Lab2 #46

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Intro/README.md
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions Intro/README.md~
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Intro/responses.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@

please work i beg
40 changes: 20 additions & 20 deletions Python/random_ints.py
Original file line number Diff line number Diff line change
@@ -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()
26 changes: 13 additions & 13 deletions Python/rm_smallest.py
Original file line number Diff line number Diff line change
@@ -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()
30 changes: 15 additions & 15 deletions Python/square_root.py
Original file line number Diff line number Diff line change
@@ -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()
24 changes: 12 additions & 12 deletions Python/sum.py
Original file line number Diff line number Diff line change
@@ -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()