Skip to content

Commit

Permalink
Added Medium Ranking Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellShibilski-Unkel committed Nov 29, 2023
1 parent a366e41 commit 7d97f40
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Medium Tests/forBreakTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import time


# Start timer
startTimer = time.perf_counter()
startTimer2 = time.process_time()

# List to cycle through
theList = ["a", "b", "i", "c", "d", "e", "n", "h", "j", ".", "m", "n", "l", "o", "t", "."]

# Start "for" loop to separate values in the list, theList
separation = "."
tempList = []
finalList = []
for i in theList:
if i == ".":
tempList.append(i)
finalList.append(tempList)
tempList = []
else:
tempList.append(i)

# Append tempList to finalList
finalList.append(tempList)

endTimer = time.perf_counter()
endTimer2 = time.process_time()

print(f"Task Finished In Performance: {endTimer - startTimer:0.8f}\nTask Finished In Process/CPU/Kernel + User Space: {endTimer2 - startTimer2:0.8f}")
22 changes: 22 additions & 0 deletions Medium Tests/forTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import time


# Start timer
startTimer = time.perf_counter()
startTimer2 = time.process_time()

# List to cycle through
theList = ["a", "b", "i", "c", "d", "e", "n", "h", "j", ".", "m", "n", "l", "o", "t", "."]

# Start "for" loop
for i in theList:
if i != ".":
continue
else:
print(i)
break

endTimer = time.perf_counter()
endTimer2 = time.process_time()

print(f"Task Finished In Performance: {endTimer - startTimer:0.8f}\nTask Finished In Process/CPU/Kernel + User Space: {endTimer2 - startTimer2:0.8f}")
17 changes: 17 additions & 0 deletions Medium Tests/sortTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import time


# Start timer
startTimer = time.perf_counter()
startTimer2 = time.process_time()

# Random numbers in a list
theList = [4, 5, 1, 3, 6, 10, 8, 9, 11, 7, 20, 22, 13, 17, 18, 12, 16, 71]

# Run sort
print(theList.sort())

endTimer = time.perf_counter()
endTimer2 = time.process_time()

print(f"Task Finished In Performance: {endTimer - startTimer:0.8f}\nTask Finished In Process/CPU/Kernel + User Space: {endTimer2 - startTimer2:0.8f}")

0 comments on commit 7d97f40

Please sign in to comment.